Learn R Programming

lawn (version 0.1.7)

lawn_filter: Filter a FeatureCollection by a given property and value

Description

Filter a FeatureCollection by a given property and value

Usage

lawn_filter(features, key, value, lint = FALSE)

Arguments

key
(character) The property on which to filter
value
(character) The value of that property on which to filter
lint
(logical) Lint or not. Uses geojsonhint. Takes up increasing time as the object to get linted increases in size, so probably use by default for small objects, but not for large if you know they are good geojson objects. Default: FALSE

Value

data-FeatureCollection - a filtered collection with only features that match input key and value

See Also

Other data functions: lawn_featurecollection, lawn_linestring, lawn_point, lawn_polygon, lawn_random, lawn_remove, lawn_sample

Examples

Run this code
cat(lawn_data$filter_features)
lawn_filter(lawn_data$filter_features, 'species', 'oak')
lawn_filter(lawn_data$filter_features, 'species', 'maple')
lawn_filter(lawn_data$filter_features, 'species', 'redwood')

Run the code above in your browser using DataLab