ABSTRACT

The sf package can be used to represent and work with spatial vector data including points, polygons, and lines, and their associated information. The sf package uses sf objects that are extensions of data frames containing a collection of simple features or spatial objects with possibly associated data. The sf object nc is a data.frame containing a collection with 100 simple features (rows) and 6 attributes (columns) plus a list-column with the geometry of each feature. One can use the st_sf() function to create a sf object by providing two elements, namely, a data.frame with the attributes of each feature, and a simple feature geometry list-column sfc containing simple feature geometries sfg. The st_as_sf() function allows people to convert a foreign object to a sf object. For example, they can have a data frame containing the coordinates of a number of locations and attributes that they wish to turn into a sf object.