Learn R Programming

lawn (version 0.6.0)

lawn_sample: Return features from FeatureCollection at random

Description

Takes a data-FeatureCollection and returns a data-FeatureCollection with given number of features at random.

Usage

lawn_sample(features = NULL, n = 100, lint = FALSE)

Arguments

n

(integer) Number of features to generate.

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

A data-FeatureCollection

See Also

Other data functions: lawn_featurecollection(), lawn_feature(), lawn_filter(), lawn_geometrycollection(), lawn_linestring(), lawn_multilinestring(), lawn_multipoint(), lawn_multipolygon(), lawn_point(), lawn_polygon(), lawn_random(), lawn_remove()

Examples

Run this code
# NOT RUN {
lawn_sample(lawn_data$points_average, 1)
lawn_sample(lawn_data$points_average, 2)
lawn_sample(lawn_data$points_average, 3)
# }

Run the code above in your browser using DataLab