Subsetting simple features (1)
Based on the sf documentation:
## S3 method for class 'sf'
x[i, j, ..., drop = FALSE, op = st_intersects]
i
: row selection (as in data frames), or asf
object to work with theop
argumentj
: column selection (as in data frames)drop
: defaultFALSE
; ifTRUE
drop the geometry column (= return data frame)op
: geometrical binary predicate function to apply wheni
is a simple feature object
So we can subset using non-spatial criteria (row and column selection) or spatial criteria (another sf
object).