Cookies help us display personalized product recommendations and ensure you have great shopping experience.

By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
SmartData CollectiveSmartData Collective
  • Analytics
    AnalyticsShow More
    image fx (67)
    Improving LinkedIn Ad Strategies with Data Analytics
    9 Min Read
    big data and remote work
    Data Helps Speech-Language Pathologists Deliver Better Results
    6 Min Read
    data driven insights
    How Data-Driven Insights Are Addressing Gaps in Patient Communication and Equity
    8 Min Read
    pexels pavel danilyuk 8112119
    Data Analytics Is Revolutionizing Medical Credentialing
    8 Min Read
    data and seo
    Maximize SEO Success with Powerful Data Analytics Insights
    8 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
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.

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

More Read

Image
When Big Data Turns Into a Big Nightmare!
Amazon: Using Big Data Analytics to Read Your Mind
The Hastings Effect: Netflix Big Data Approach Is Transforming Education
After 31 Years of Spreadsheets, It’s Time to Move On
7 Big Data Trends That Will Impact Your Business

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:

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

image fx (2)
Monitoring Data Without Turning into Big Brother
Big Data Exclusive
image fx (71)
The Power of AI for Personalization in Email
Artificial Intelligence Exclusive Marketing
image fx (67)
Improving LinkedIn Ad Strategies with Data Analytics
Analytics Big Data Exclusive Software
big data and remote work
Data Helps Speech-Language Pathologists Deliver Better Results
Analytics Big Data Exclusive

Stay Connected

1.2kFollowersLike
33.7kFollowersFollow
222FollowersPin

You Might also Like

Oracle’s Big Data Appliance to include R

4 Min Read

Paul Murrell on Incorporating Images in R Charts

3 Min Read

Who Gets the Call When Your Analytics Process Crashes?

6 Min Read

A Question of Scope

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.

ai in ecommerce
Artificial Intelligence for eCommerce: A Closer Look
Artificial Intelligence
giveaway chatbots
How To Get An Award Winning Giveaway Bot
Big Data Chatbots Exclusive

Quick Link

  • About
  • Contact
  • Privacy
Follow US
© 2008-25 SmartData Collective. All Rights Reserved.
Go to mobile version
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?