Wraps a matrix of counts (sites in rows, occasions in columns) so that it can
be prepared for modeling by pam_model_input(). pam_count_history() builds the same
object from the detections of a project; use this function when the counts
come from somewhere else.
Usage
pam_as_count_history(
y,
site_covariates = NULL,
effort = NULL,
day = NULL,
occasions = NULL,
species = NA_character_,
count = "events"
)Arguments
- y
A matrix of whole-number counts, sites in rows and occasions in columns, with
NAwhere a site was not surveyed. Row names are the site identifiers (made up if missing).- site_covariates
Optional data frame of site covariates. With a
site_idcolumn the rows are matched to the sites by name, otherwise there must be one row per site in the same order.- effort
Optional matrix (same shape as
y) of recording hours per site and occasion, usable as a detection covariate namedeffort.- day
Optional matrix (same shape as
y) of days since the first occasion, usable as a detection covariate namedday. By default the occasion number minus one.- occasions
Optional data frame describing the occasions, one row per column of
y.- species
Name of the species, for labeling.
- count
What the counts are:
"events"or"files"(for labeling).
Value
An object of class pam_count_history: a list with y, effort,
day, site_covariates, occasions, species and count.
