ABSTRACT

This chapter examines how to work with spatial data in R, how to make maps, and how to extract samples and other information from spatial data. One of the most important pieces of information required in any project report is a map of the project area or one showing where the data was gathered. Spatial data is a fast developing area with many different R packages available. The chapter focuses on two key packages for dealing with each of the data types: sf package: for vector data; and raster package: for raster data. Spatial data is data which represents a location in space. The sf package stands for ‘simple features’, and simplifies spatial data types by handling them as data frames. One of the simplest ways of combining maps and data is through a visualisation called a chloropleth. Typically, chloropleths map the value of variable through a shade or colour gradient.