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

Description Usage Arguments Details Value Examples

View source: R/ec_pa.R

Description

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

Usage

1
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

1
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 Aug. 7, 2021, 8:22 p.m.