Learn R Programming

SpaDES.tools (version 2.0.6)

randomPolygons: Produce a SpatRaster of random polygons

Description

These 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.

Usage

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)

Value

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

Arguments

ras

A raster that whose extent will be used for the random polygons.

numTypes

Numeric value. The number of unique polygon types to use.

...

Other arguments passed to spread. No known uses currently.

x

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)

hectares

Deprecated. Use area in meters squared.

area

A numeric, the approximate area in meters squared of the random polygon.

See Also

spread(), randomPolygons()