Research Fellow, International Institute of Tropical Agriculture (IITA)
Oluwafemi Oyedele
About me
I am a Agrometeorologist and Crop Simulation modeler
I am a member of R4DS online learning community
I am also a active member of the TidyTuesday project
: @OluwafemOyedele 👍
Intro (this section)
Getting to know vector data in R
Getting to know raster data in R
Getting your spatial data into R
Coordinate reference systems (CRS)
Mapping your spatial data
Technically spatial can refer to non-earth based positions and geographic/geospatial is a subset
Spatial Data refers to geographic data in Space.
Points, lines and polygons can have associated, non spatial data
In the example below the non-spatial variables of coastline10 dataset are featurecla, scalerank, min_zoom.
Rows: 4,133
Columns: 4
$ featurecla <chr> "Coastline", "Coastline", "Coastline", "Coastline", "Coastl…
$ scalerank <chr> "0", "0", "6", "0", "0", "6", "5", "5", "6", "6", "6", "6",…
$ min_zoom <dbl> 0, 0, 5, 0, 0, 5, 3, 3, 6, 5, 5, 6, 5, 6, 3, 3, 6, 6, 0, 6,…
$ geometry <LINESTRING [°]> LINESTRING (59.91603 -67.40..., LINESTRING (-51.…
Shapefiles
Geopackages
GeoJSON
IMG
TIF
SID
{sf}
{raster}
{tmap} or {ggplot2}
{mapview} or {leaflet}
A package for vector data
For creating interactive maps
{ggspatial}
{leaflet}
{ggmap}
{tidycensus}
{rayshader}
{rgrass7}
{stars}
{geogrid}
Load external spatial files
Load or fetch data with specialized R packages
Read vector data with the {sf} package
Read raster data with the {raster} package
stringsAsFactors = FALSE
quiet = TRUE
as_tibble = TRUE
Shapefiles
Geopackages
Geojson
Even databases!