gt_filter: Subset a geometric object using column values

Description Usage Arguments Value See Also Examples

View source: R/gt_filter.R

Description

This function allows to subset any geometric object for which all required getters are available.

Usage

1

Arguments

obj

[geometric object(1)]
the object to derive a subset from.

...

subset based on logical predicates defined in terms of the columns in x (of both, points, features and groups). Multiple conditions are combined with &. Only rows where the condition evaluates to TRUE are kept.

update

[logical(1)]
whether or not to update the window slot after deriving the subset.

Value

geom of the subset of obj.

See Also

Other geometry tools: gt_locate(), gt_pull(), gt_reflect(), gt_rotate(), gt_scale(), gt_skew(), gt_stretch(), gt_translate()

Examples

1
2
3
4
5
# get a subset of a geom
gt_filter(gtGeoms$point, y < -10)

# get a subset of an sf-object
gt_filter(obj = gtSF$multilinestring, a == 1)

geometr documentation built on Sept. 21, 2021, 1:07 a.m.