This function allows to subset any geometric object for which all required getters are available.
gt_filter(obj, ..., update = TRUE)
obj | [ |
---|---|
... | subset based on logical predicates defined in terms of the columns
in |
update | [ |
geom
of the subset of obj
.
Other geometry tools:
gt_locate()
,
gt_pull()
,
gt_reflect()
,
gt_rotate()
,
gt_scale()
,
gt_skew()
,
gt_stretch()
,
gt_translate()
gt_filter(gtGeoms$point, y < -10) #> geom point #> 2 groups | 4 features | 4 points #> crs cartesian #> attributes -- #> tiny map -20 #> ◌ ◌ ◌ ◌ #> ◌ ◌ ◌ ◌ #> ◌ ◌ ◌ ◌ #> -34.64 ◌ ◎ ◎ ◌ 34.64 #> -40 newObj <- setFeatures(x = gtGeoms$point, table = data.frame(fid = c(1:9), attrib = c(letters[1:9]))) gt_filter(obj = newObj, attrib %in% c("a", "c", "e")) #> geom point #> 1 group | 3 features | 3 points #> crs cartesian #> attributes (features) attrib #> tiny map 20 #> ◌ ◌ ◌ ◌ #> ◌ ◌ ◌ ◌ #> ◌ ◌ ◌ ◌ #> -34.64 ◌ ◉ ◉ ◌ 34.64 #> -40