j.occs: Expected value of joint occupancy and its standard deviation...

View source: R/J.occupancy.R

j.occsR Documentation

Expected value of joint occupancy and its standard deviation for a range of orders

Description

This function computes joint occupancy (the average number of sites harbouring a given number of i species simultaneously) and its standard deviation for a range of orders (number of species).

Usage

j.occs(s.data, orders = 1:nrow(s.data), metric = "raw")

Arguments

s.data

A species-by-site presence/absence matrix with entries indicating occurrence (1) and non-occurrence (0) of species in a site.

orders

Range number of species for which joint occupancy and its standard deviation is computed.

metric

The type of rescaling applied to the joint occupancy metric. Available options are: Simpson_eqn for Simpson equivalent, Sorensen_eqn for Sorensen equivalent, and raw for the raw form of index without rescaling.

Value

Returns a list with the following outputs:

jo.vals

A vector of joint occupancy values for a range number of species (in orders).

jo.sds

A vector of standard deviations of jo.vals.

References

Lagat, V. K., Latombe, G. and Hui, C. (2021a). A multi-species co-occurrence index to avoid type II errors in null model testing. DOI: ⁠<To be added>⁠.

Examples

ex.data <- read.csv(system.file("extdata", "274.csv", package = "msco"))
jos <- msco::j.occs(ex.data, orders = 1:nrow(ex.data), metric = "raw")
jos

ex.data2 <- read.csv(system.file("extdata", "65.csv", package = "msco"))
jos2 <- msco::j.occs(ex.data2, orders = 1:nrow(ex.data), metric = "raw")
jos2

vitaliskim/msco documentation built on Sept. 29, 2023, 9:22 p.m.