Creates quadrat polygons for sampling or analysis

quadrats(x, s = 250, n = 100, r = NULL)

Arguments

x

A sp or sf polygon object defining extent

s

Radius defining single or range of sizes of quadrats

n

Number of quadrats

r

A rotation factor for random rotation, default is NULL

Value

an sp or sf polygon object with rotated polygon

Note

The radius (s) parameter can be a single value or a range of values, representing a randomization range of resulting quadrat sizes. The rotation (r) parameter can also be used to defined a fixed rotation or random range of quadrat rotations. You can specify each of these parameters using an explicit vector that will be sampled eg., seq(100,300,0.5)

Examples

library(sp) library(raster) library(rgeos) data(meuse) coordinates(meuse) <- ~x+y e <- gConvexHull(meuse) # Fixed size 250 and no rotation s <- quadrats(e, s = 250, n = 50)
#> Error in quadrats(e, s = 250, n = 50): argument 3 matches multiple formal arguments
spplot(s, "ID")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'obj' in selecting a method for function 'spplot': object 's' not found
# Variable sizes 100-300 and rotation of 0-45 degrees s <- quadrats(e, s = c(100,300), n = 50, r = c(0,45))
#> Error in quadrats(e, s = c(100, 300), n = 50, r = c(0, 45)): argument 3 matches multiple formal arguments
spplot(s, "ID")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'obj' in selecting a method for function 'spplot': object 's' not found
# Variable sizes 100-300 and no rotation s <- quadrats(e, s = c(100,300), n = 50)
#> Error in quadrats(e, s = c(100, 300), n = 50): argument 3 matches multiple formal arguments
spplot(s, "ID")
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'obj' in selecting a method for function 'spplot': object 's' not found