SpatRaster of random polygonsThese are built with the spread() function internally.
Produces a SpatVector polygons object with 1 feature that will have approximately an area
equal to area (expecting area in hectares), #' and a centre at approximately x.
randomPolygons(
ras = rast(ext(0, 15, 0, 15), res = 1, vals = 0),
numTypes = 2,
...
)randomPolygon(x, hectares, area)
# S3 method for default
randomPolygon(x, hectares, area)
A map of extent ext with random polygons.
A SpatVector polygons object, with approximately the area request,
centred approximately at the coordinates requested, in the projection of x.
A raster that whose extent will be used for the random polygons.
Numeric value. The number of unique polygon types to use.
Other arguments passed to spread. No known uses currently.
Either a SpatVector, or SpatialPoints (deprecated), SpatialPolygons (deprecated),
or matrix with two dimensions, 1 row, with the approximate centre of the new random
polygon to create.
If matrix, then longitude and latitude are assumed (epsg:4326).
Deprecated. Use area in meters squared.
A numeric, the approximate area in meters squared of the random polygon.
spread(), randomPolygons()