ec_pa: Create a presence/absence object Create a presence/absence...

View source: R/ec_pa.R

ec_paR Documentation

Create a presence/absence object Create a presence/absence (pa) object from a matrix.

Description

Create a presence/absence object Create a presence/absence (pa) object from a matrix.

Usage

ec_pa(x, threshold = 0, spc_name = NULL, sit_name = NULL)

Arguments

x

a R object to be coerced as a matrix.

threshold

threshold value. Above (strictly) this value, a species is considered present.

spc_name

vector of species names.

sit_name

vector of site names.

Details

The input x should be a presence absence matrix (sites as rows and species as columns), it could be either a logical one or a numeric one. In the latter case, presence and absence will be determined based on threshold. If there are less names than species (or sites), or no names at all, then names will be automatically added. These names are created using column or row numbers (zero-padded to the number of digits of total the number of column or row), preceded by spc_ for column and sit_ for sites.

Value

An object of class pa which basically is a matrix of 0 (absence) and 1 (presence).

Examples

ec_pa(matrix(c(0, 0, 0, 1, 1, 0, 1, 0, 0), 3, 3), spc_name = "Lynx", sit_name = "ON_001")

KevCaz/ecoocc documentation built on May 24, 2023, 1:43 p.m.