Learn R Programming

spatialEco (version 1.3-5)

quadrats: Quadrats

Description

Creates quadrat polygons for sampling or analysis

Usage

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

Examples

Run this code
# NOT RUN {
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)
  spplot(s, "ID")

# Variable sizes 100-300 and rotation of 0-45 degrees
s <- quadrats(e, s = c(100,300), n = 50, r = c(0,45))
  spplot(s, "ID")

# Variable sizes 100-300 and no rotation 
s <- quadrats(e, s = c(100,300), n = 50)
  spplot(s, "ID")

# }

Run the code above in your browser using DataLab