Skip to main content
HomeR

Course

Visualizing Geospatial Data in R

IntermediateSkill Level
4.5+
83 reviews
Updated 11/2025
Learn to read, explore, and manipulate spatial data then use your skills to create informative maps using R.
Start Course for Free
RData Visualization4 hr15 videos58 Exercises5,000 XP29,630Statement of Accomplishment

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Loved by learners at thousands of companies

Group

Training 2 or more people?

Try DataCamp for Business

Course Description

Where should you buy a house to get the most value for your money? Your first step might be to make a map, but spatial analysis in R can be intimidating because of the complicated objects the data often live in.

This course will introduce you to spatial data by starting with objects you already know about, data frames, before introducing you to the special objects from the sp and raster packages used to represent spatial data for analysis in R. You'll learn to read, explore, and manipulate these objects with the big payoff of being able to use the tmap package to make maps.

By the end of the course you will have made maps of property sales in a small town, populations of the countries of the world, the distribution of people in the North East of the USA, and median income in the neighborhoods of New York City.

Prerequisites

Introduction to RIntroduction to Data Visualization with ggplot2
1

Basic mapping with ggplot2 and ggmap

We'll dive in by displaying some spatial data -- property sales in a small US town -- using ggplot2 and we'll introduce you to the ggmap package as a quick way to add spatial context to your plots. We'll talk about what makes spatial data special and introduce you to the common types of spatial data we'll be working with throughout the course.
Start Chapter
2

Point and polygon data

You can get a long way with spatial data stored in data frames, but it makes life easier if they are stored in special spatial objects. In this chapter we'll introduce you to the spatial object classes provided by the sp package, particularly for point and polygon data. You'll learn how to explore and subset these objects by exploring a world map. The reward for learning about these object classes: we'll show you the package tmap which requires spatial objects as input, but makes creating maps really easy! You'll finish up by making a map of the world's population.
Start Chapter
3

Raster data and color

While the sp package provides some classes for raster data, the raster package provides more useful classes. You'll be introduced to these classes and their advantages and then learn to display them. The examples continue with the theme of population from Chapter 2, but you'll look at some much finer detail datasets, both spatially and demographically. In the second half of the chapter you'll learn about color -- an essential part of any visual display, but especially important for maps.
Start Chapter
4

Data import and projections

Visualizing Geospatial Data in R
Course
Complete

Earn Statement of Accomplishment

Add this credential to your LinkedIn profile, resume, or CV
Share it on social media and in your performance review
Enroll Now

Don’t just take our word for it

*4.5
from 83 reviews
71%
19%
7%
1%
1%
  • Divyangbhai
    last month

  • Ameeta
    2 months ago

    Difficult

  • Elijah
    2 months ago

    I enjoyed the course greatly đź’–

  • Stanislau
    2 months ago

  • James
    2 months ago

  • Nathalie
    3 months ago

Divyangbhai

"I enjoyed the course greatly đź’–"

Elijah

Stanislau

FAQs

What R packages does this course use for spatial analysis and mapping?

You use ggplot2 and ggmap for basic mapping, the sp package for spatial object classes, the raster package for raster data, and tmap for creating polished thematic maps.

What maps will I create during this course?

You build maps of property sales in a small town, world country populations, population distribution in the northeastern USA, and median income across New York City neighborhoods.

Do I need prior experience with spatial data or GIS tools?

No. This is a beginner course. It starts with familiar data frames before introducing specialized spatial objects, making it accessible if you know basic R and ggplot2.

Does this course cover map projections and coordinate reference systems?

Yes. Chapter 4 covers projections and coordinate reference systems, along with reading spatial data files and adding external data to spatial objects.

How does the course teach color choices for maps?

Chapter 3 includes a dedicated section on color theory for maps, covering why color choices are especially important in cartography and how to apply them effectively in R.

Join over 19 million learners and start Visualizing Geospatial Data in R today!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.

Grow your data skills with DataCamp for Mobile

Make progress on the go with our mobile courses and daily 5-minute coding challenges.