community: Create spatial community object

View source: R/Sim_Community.R

communityR Documentation

Create spatial community object

Description

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

Usage

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

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)


mobsim documentation built on May 29, 2024, 8:15 a.m.