occData: Compute Occupancy Data Matrices

View source: R/occData.R

occDataR Documentation

Compute Occupancy Data Matrices

Description

Computes occupancy data matrices from a data frame of tabular detection data.

Usage

occData(d, siteColName = "site", sampleColName = "sample")

Arguments

d

data frame containing tabular detection data

siteColName

column of data frame d containing sites (i.e., primary sample units)

sampleColName

column of data frame d containing sample numbers (i.e., integers 1, 2, ...) for each site

Details

This function takes a data frame of tabular detection data and returns a list containing a matrix of numbers of detections per sample and a matrix of numbers of replicates per sample.

The number of samples per site may differ among sites. In addition, the number of replicates per sample may differ among samples. Such unbalanced designs will induce NAs in the detection matrix (y) and zeros in the replicate number matrix (K).

Value

A list containing two matrices:

y:

M x J matrix of numbers of detections per sample

K:

M x J matrix of numbers of replicates per sample

where M = no. sites and J = maximum no. samples per site

Examples

data(gobyDetectionData)

occData(gobyDetectionData, "site", "sample")

RobertDorazio/eDNAoccupancy documentation built on Sept. 5, 2023, 9:57 a.m.