We use cookies, including third-party cookies from Google to serve personalized ads through AdSense, to operate this site and understand how it is used. By continuing to browse, you accept this use. See our Privacy Policy and Terms of Use for details, including how to opt out of personalized advertising.
Accept
SmartData CollectiveSmartData Collective
  • Analytics
    AnalyticsShow More
    What Kind of Problem-Solving Distinguishes Data Analysts From Software Engineers -- AI-generated illustration
    What Kind of Problem-Solving Distinguishes Data Analysts From Software Engineers
    7 Min Read
    chatgpt image jul 21, 2026, 04 34 30 pm
    4 Core Benefits of Predictive Maintenance after Vibration Analysis
    10 Min Read
    How Does Data Mining Boost Customer Satisfaction in Logistics? Harnessing Analytics for Results -- AI-generated illustration
    How Does Data Mining Boost Customer Satisfaction in Logistics? Harnessing Analytics for Results
    11 Min Read
    chatgpt image jul 13, 2026, 04 23 45 pm
    How Data Analytics Helps Companies Improve User Engagement
    19 Min Read
    chatgpt image jul 13, 2026, 03 59 46 pm
    How Data Analytics Improves Multi-Location Search Strategies
    10 Min Read
  • Big Data
  • BI
  • Exclusive
  • IT
  • Marketing
  • Software
Search
© 2008-25 SmartData Collective. All Rights Reserved.
Reading: Creating Beautiful Maps with R
Share
Notification
Font ResizerAa
SmartData CollectiveSmartData Collective
Font ResizerAa
Search
  • About
  • Help
  • Privacy
Follow US
© 2008-23 SmartData Collective. All Rights Reserved.
SmartData Collective > Analytics > Modeling > Creating Beautiful Maps with R
ModelingR Programming Language

Creating Beautiful Maps with R

DavidMSmith
DavidMSmith
3 Min Read
Creating Beautiful Maps with R
Illustrative image generated with OpenAI gpt-image-1.
SHARE

Spanish R user and solar energy lecturer Oscar Perpiñán Lamigueiro has written a detailed three-part guide to creating beautiful maps and choropleths (maps color-coded with regional data) using the R language. Motivated by the desire to recreate this graphic from the New York Times, Oscar describes how he creates similar high-quality maps using R.

NYT immigration explorer

In Part 1, Oscar grabbed some voting data from Spanish elections and shapefiles (detailed map coordinates) from Spain’s Official Statistics department (INE) and set to work in R. He then used the maptools package and lattice graphics to create this choropleth of voting patterns in Spain:

More Read

Are You a Networking Expert? Big Data May Have You Beat
Are You a Networking Expert? Big Data May Have You Beat
The Fallacy of the Data Scientist Shortage
Geospatial Data On-Demand
3 Hours of Pure Soccer Emotion, Visualized with R
The Journey from Big Data to Big Promise

Part1
In Part 2, he uses the raster package to import pixel-based environmental data from NASA, to create a map that combines population density, land use and land cover in a single map. (Personally, I find it very difficult to interpret such multivariate maps encoded in multiple dimensions of color, but the process is interesting.)

Pop_landclass

Finally in Part 3, Oscar uses the pxR package to read map data in the PC-Axis format, and the gridSVG package to create an interactive SVG map. If you have a modern browser, you can click the image below, and then annotations will appear as move your mouse over the regions. [Updated: as Oscar explains in the blog, the annotiations require Javascript to work, so I’ve changed the image below to link to Oscar’s annotated version.]

Map with annotations
With these examples, you can see how you can get close to the types of maps featured in the New York Times (which, themselves, often involve R in their production). You can find the data and R code used to create these maps at Oscar’s blog linked below.

Omnia sunt Communia!: Maps with R (III)

Share This Article
Facebook Pinterest LinkedIn
Share

Follow us on Facebook

Latest News

Flat editorial illustration: The article connects fragmented social-service records through shared pathways and selective informa
Turning Disconnected Information Data Into Better Social Service Outcomes
Big Data
Flat editorial illustration: The article explains how one KYC upload becomes separate records held by a verification vendor and a
What Happens to My KYC Data Behind the Approval Screen?
Big Data Exclusive
Flat editorial illustration: The article connects AI-generated avatar variants with disciplined, measurable video experiments. A
How to Use an AI Avatar Generator to Run Measurable Video Experiments
Artificial Intelligence Exclusive
Flat editorial illustration: The article’s core relationship is between growing compute density and adaptable rack hardware that
6 Details That Make a Data Centre’s Server Room Easier to Scale
Best Practices Data Management Exclusive IT

Stay Connected

1.2KFollowersLike
33.7KFollowersFollow
222FollowersPin

You Might also Like

Image
Business IntelligenceData VisualizationDecision ManagementKnowledge ManagementModeling

Big Data: Where Did All The Water Go?

7 Min Read
Leveraging Analytics to Improve Enterprise Performance Management
AnalyticsBig DataCloud ComputingModelingSoftware

Leveraging Analytics to Improve Enterprise Performance Management

5 Min Read
Where to Find Data to Use with R
R Programming Language

Where to Find Data to Use with R

6 Min Read
Science Needs to Be Less Certain
AnalyticsBig DataCommentaryData VisualizationData WarehousingExclusiveModelingPredictive AnalyticsRisk Management

Science Needs to Be Less Certain

5 Min Read

SmartData Collective is one of the largest & trusted community covering technical content about Big Data, BI, Cloud, Analytics, Artificial Intelligence, IoT & more.

Chatbots and SEO: How Can Chatbots Improve Your SEO Ranking?
Chatbots and SEO: How Can Chatbots Improve Your SEO Ranking?
Artificial Intelligence Chatbots Exclusive
Artificial Intelligence for eCommerce: A Closer Look
Artificial Intelligence for eCommerce: A Closer Look
Artificial Intelligence

Quick Link

  • About
  • Contact
  • Privacy
Follow US
© 2008-26 SmartData Collective. All Rights Reserved.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?