Learn R Programming

geometr (version 0.2.10)

gt_filter: Subset a geometric object using column values

Description

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

Usage

gt_filter(obj, ..., update = TRUE)

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

Run this code
# NOT RUN {
# 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)
# }

Run the code above in your browser using DataLab