R Programming Language

R is a programming language and free software environment for statistical computing and graphics supported by the R Core Team and the R Foundation for Statistical Computing. It is widely used among statisticians and data miners for developing statistical software and data analysis.

I do not recommend tmap πŸ—Ί

I do not recommend tmap πŸ—Ί

The authors of tmap wrote a wrapper around ggplot2 to make mapping in R easier for beginners. But the thing is you use a lot of flexibility by using the default settings in tmap, you would gain by learning the ins and outs of ggplot2. The next result is very generic looking maps that are functional but not pretty.

Now I’m not condemning the work that tmap represents but I encourage you to learn more about R and ggplot2 for making maps. You can always cut and paste your favorite settings from script to script or create a custom function with the details you want on your maps. No need to limit yourself to the basic maps produced by tmap in R.

Need a quick Census TIGER/Line Shapefile for a map you are making? πŸ—Ί

Need a quick Census TIGER/Line Shapefile for a map you are making? πŸ—Ί

It is super easy to get using R and tigris and sf libraries. I often will run a command like this in R terminal to get a Shapefile of the of the counties in Maine.

library(sf)
library(tigris)

counties(‘me’, cb=T) %>% write_sf(‘/tmp/maine.shp’)

Other common tigris functions I will use is state, county_subdivision, tract, block_group and school_districts which work similarly. A resolution parameter can be supplied to control the resolution downloaded, the cb=T flag obtains cartographic boundaries which follow coast lines, rather then actual boundaries.