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

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

Arguments

features

A data-FeatureCollection

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

Examples

lawn_sample(lawn_data$points_average, 1)
#> <FeatureCollection> #> Bounding box: 10.8 59.9 10.8 59.9 #> No. features: 1 #> No. points: 2 #> Properties: #> population #> 1 300
lawn_sample(lawn_data$points_average, 2)
#> <FeatureCollection> #> Bounding box: 10.8 59.9 10.8 59.9 #> No. features: 2 #> No. points: 4 #> Properties: #> population #> 1 300 #> 2 200
lawn_sample(lawn_data$points_average, 3)
#> <FeatureCollection> #> Bounding box: 10.7 59.9 10.8 59.9 #> No. features: 3 #> No. points: 6 #> Properties: #> population #> 1 600 #> 2 200 #> 3 200