Skip to Main Content

R: Mapping and Geospatial

Geospatial applications using the R programming language

Visualizing / Mapping Packages

See the Getting Data tab of this guide for information on the shift_geometry() function of the tigris Package and the shift_geo = TRUE argument of the tidycensus Package. These create maps of the United States with Alaska, Hawaii, and Puerto Rico shifted (and alternatively rescaled) to closer proximity to the continental US, for more compact visualizations.

Try the ggplot2 function stat_density_2d() to create heatmaps indicating density of a point layer. See also the discussion at earthdatascience.org.

Install cividis using devtools. (Install the devtool package if needed.)

# install.packages("devtools")
devtools::install_github("marcosci/cividis")