Skip to content
R for the Rest of Us Logo

Mapping with R

34 lessons

Starting a Map in ggplot2 (02_02)

This lesson is locked

Get access to all lessons in this course.

If the video is not playing correctly, you can watch it in a new window


Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.

Learn More

In the video I showed that the different map tiles available when usingthe annotation_map_tile() function from the ggspatial package. The list of all map tiles can be found by running this code: rosm::osm.types()

Have any questions? Put them below and we will help you out!

You need to be signed-in to comment on this post. Login.

Jordan Trachtenberg

Jordan Trachtenberg

April 29, 2022

Hi Charlie,

I'm getting an error when I try to run the script at 4:37. Any idea why this is happening?

Error in loadNamespace(name) : there is no package called ‘prettymapr’ > install.packages("prettymapr") Installing package into ‘C:/Users/trachten/Documents/R/win-library/3.6’ (as ‘lib’ is unspecified) Warning in install.packages : dependency ‘rjson’ is not available

There is a binary version available but the source version is later: binary source needs_compilation prettymapr 0.2.2 0.2.3 FALSE

installing the source package ‘prettymapr’

trying URL '' Content type 'application/x-gzip' length 871467 bytes (851 KB) downloaded 851 KB

ERROR: dependency 'rjson' is not available for package 'prettymapr'

  • removing 'C:/Users/trachten/Documents/R/win-library/3.6/prettymapr' Warning in install.packages : installation of package ‘prettymapr’ had non-zero exit status

The downloaded source packages are in ‘C:\Users\trachten\AppData\Local\Temp\RtmpUZkfJf\downloaded_packages’

Jordan Trachtenberg

Jordan Trachtenberg

April 29, 2022

Hi Charlie. I figured it out. I had to update my R version to 4.2.0 and update RStudio ("Prairie Trillium" Release (8acbd38b, 2022-04-19) for Windows). It seems to be working now.