ct_rest_stay: Prepare staying-time data for REST

View source: R/ct_rest_data.R

ct_rest_stayR Documentation

Prepare staying-time data for REST

Description

Selects and standardises the staying-time and censoring columns from a detection table and attaches per-station covariates.

Usage

ct_rest_stay(
  detection_data,
  station_data,
  station_column = "Station",
  species_column = "Species",
  stay_column = "Stay",
  censor_column = "Cens"
)

Arguments

detection_data

A data frame with one row per video / detection.

station_data

A data frame with one row per camera station.

station_column, species_column

Columns giving the station ID and species in detection_data.

stay_column

Column holding the staying time in seconds.

censor_column

Column holding the censoring flag (1 = censored, 0 = fully observed).

Value

A tibble with columns Station, Species, Stay, Cens plus any station covariates, ready for ct_fit_rest().

Examples

data(rest_detection)
data(rest_station)

# Column names can be strings, bare names, or positions:
stay <- ct_rest_stay(rest_detection, rest_station, stay_column = Stay)
head(stay)

ct documentation built on Oct. 22, 2026, 1:07 a.m.