#set chunk options

library(knitr)

opts_chunk$set(warning=FALSE, message=FALSE)
               #fig.width=8.5,
               #fig.height=8.5)

There are lots of options for making maps in R

I'm just going to briefly introduce you to a few

This is a great introductory online book if you want to take things further :

https://geocompr.robinlovelace.net/

loading some map packages

library(tmap)
library(rnaturalearth)

sf_uk <- ne_countries(country = 'united kingdom', type = 'map_units', 
                      scale = 'medium', returnclass = 'sf')

tm_shape(sf_uk) + tm_polygons('name') 

data("World")

tm_shape(World) + tm_polygons("HPI")

tmap_mode("view")

tm_shape(World) +
    tm_polygons("HPI")



AndySouth/rmapteach documentation built on May 5, 2019, 6:01 a.m.