9.2 Add a temperature raster
If we were interested in the latitudinal temperature gradient, we could add a raster of mean temperature as a background to our map. We will use a low resolution so it does not take to long.
#R> Warning in getData("worldclim", var = "tmean", res = 10, path = "data"): getData will be removed in a future version of raster
#R> . Please use the geodata package instead
# Change projection to match with the polygons
temp <- projectRaster(temp, crs = st_crs(qc_simple)$proj4string)
#R> Warning in projectRaster(temp, crs = st_crs(qc_simple)$proj4string): input and
#R> ouput crs are the same