community: Create spatial community object

Description Usage Arguments Value Examples

View source: R/Sim_Community.R

Description

Creates a spatial community object with defined extent and with coordinates and species identities of all individuals in the community.

Usage

1
community(x, y, spec_id, xrange = c(0, 1), yrange = c(0, 1))

Arguments

x, y

Coordinates of individuals (numeric)

spec_id

Species names or IDs; can be integers, characters or factors

xrange

Extent of the community in x-direction (numeric vector of length 2)

yrange

Extent of the community in y-direction (numeric vector of length 2)

Value

Community object which includes three items:

  1. census: data.frame with three columns: x, y, and species names for each individual

  2. x_min_max: extent of the community in x-direction

  3. y_min_max: extent of the community in y-direction

Examples

1
2
3
4
5
6
7
x <- runif(100)
y <- runif(100)
species_names <- rep(paste("species",1:10, sep = ""), each = 10)

com1 <- community(x,y, species_names)
plot(com1)
summary(com1)

MoBiodiv/MoBspatial documentation built on July 24, 2021, 6:09 p.m.