From the course: Creating Maps with R
Unlock the full course today
Join today to access over 24,200 courses taught by industry experts.
Vector GIS data: sf and sp
From the course: Creating Maps with R
Vector GIS data: sf and sp
- [Instructor] When it comes to working with vector GIS data in R, there are two packages of note, sf and sp. The sp package is now considered out of date and is to some extents being retired in 2023. I would strongly recommend against writing new code that uses the sp package. The sf package is designed by the r-spatial team to provide a complete suite of tools for importing, wrangling, and manipulating vector GIS data. It's also designed to consume and convert sp objects, allowing you to make use of old code that uses sp and to write new code using sf. Sf is also Tidyverse friendly, meaning it can be used with functions from both dplyr and tidyr. Sf objects are data frame with additional geometry attributes. This means that sf objects can be wrangled almost exactly like a regular data frame, including mutating, joining, and filtering. It's also really easy to visualize sf objects with the ggplot2 package in pretty…