sample_quadrats: Plot-based samples from a spatially-explicit census

View source: R/Sample_quadrats.R

sample_quadratsR Documentation

Plot-based samples from a spatially-explicit census

Description

This function allows to sample quadratic subplots from a spatially-explicit community. The output format are a sites x species abundance table and a sites x xy-coordinates table. The sites x species abundance is a classical data format used in community ecology. The table generated can be for instance be further analysed with the package vegan.

Usage

sample_quadrats(
  comm,
  n_quadrats = 20,
  quadrat_area = 0.01,
  plot = TRUE,
  method = "random",
  avoid_overlap = TRUE,
  x0 = 0,
  y0 = 0,
  delta_x = 0.1,
  delta_y = 0.1,
  seed = NULL
)

Arguments

comm

Community object from which the samples are generated

n_quadrats

(integer) Number of sampling quadrats

quadrat_area

(numeric) Area of the sampling quadrats

plot

(logical) Should the sampling design be plotted? default to TRUE.

method

(character) Available methods are "random", "transect", "grid"

avoid_overlap

(logical) For the random sampling try to generate a design without overlap of quadrats . Default is TRUE.

x0, y0

(numeric value) Lower left corner of the first quadrat in transect and grid sampling

delta_x

(numeric value) Distance between consecutive quadrats in transect and grid sampling in x-direction (the distance between the left sides is measured)

delta_y

(numeric value) Distance between consecutive quadrats in transect and grid sampling in y-direction (the distance between the lower sides is measured)

seed

(integer) Any integer passed to set.seed for reproducibility.

Value

A list with two items, spec_dat and xy_dat. spec_dat is a data.frame with sampling quadrats in rows and species abundances in columns, and xy_dat is a data.frame with sampling quadrats in rows and the xy-coordinates of the quadrats (lower left corner) in columns.

Examples

library(vegan)
sim_com1 <- sim_poisson_community(100, 10000)
comm_mat1 <- sample_quadrats(sim_com1, n_quadrats = 100,
quadrat_area = 0.002, method = "grid")
specnumber(comm_mat1$spec_dat)
diversity(comm_mat1$spec_dat, index = "shannon")


FelixMay/MoBspatial documentation built on March 26, 2024, 1:14 a.m.