Exploring vector layer properties and subsetting
This section is going to be devoted to the examination of spatial vector layer properties, and to subsetting them based on their attribute tables. Some of the presented procedures will be analogous to those presented for rasters in the previous chapter (for example, plotting and querying CRS information), while others are generally relevant only to vector layers (for example, calculating areas and creating subsets according to the attribute table). As will quickly become apparent, many operations involving attribute tables of vector layers are conveniently analogous to operations on data.frame
objects.
Examining vector layer properties
The summary
function produces a useful textual summary of the properties of a vector layer, including its class, bounding box coordinates, CRS, and attribute table column types. For example, using summary
on airports
produces the following textual output:
> summary(airports) Object of class SpatialPointsDataFrame...