View source: R/aggregateStations.R
| aggregateStations | R Documentation |
Aggregates a camera trap table from a station-camera (location-deployment) level to a station (location) level. This function is useful when modeling or analysis is conducted at the station level, when multiple cameras were deployed at a single station or a single camera had multiple deployments.
aggregateStations(
CTtable,
stationCol,
cameraCol = NULL,
setupCol = NULL,
retrievalCol = NULL,
dateFormat = NULL
)
CTtable |
A data frame or 'sf' object representing the camera trap table. Each row typically represents a unique camera deployment. |
stationCol |
A character string specifying the name of the column in |
cameraCol |
A character string specifying the name of the column in |
setupCol |
character. name of the column containing camera setup dates
in |
retrievalCol |
character. name of the column containing camera
retrieval dates in |
dateFormat |
character. The format of columns |
The aggregation logic handles different column types as follows:
Station ID (specified by 'stationCol'): Remains unique for each row in the output.
Camera ID (if present): A character vector (comma-separated) of unique camera IDs deployed at that station.
Setup/Retrieval Dates: The earliest setup date and the latest retrieval date for all deployments within a station will be retained.
Numeric Columns: The 'mean' of all values for that station will be calculated.
Logical Columns: The 'mean' (which effectively calculates the proportion of 'TRUE's) of all values for that station will be calculated.
Character Columns (other than Camera ID): A character vector of unique values (comma-separated) for that station will be created.
Factor Columns: Similar to character columns, unique levels will be combined.
Geometry Column ('sf' objects): Centroid (midpoint) of all unique points at a station is calculated.
It is recommended to inspect the aggregated output carefully, especially for columns with mixed data types or specific aggregation requirements not covered by the defaults.
A data frame with one row per unique station, containing aggregated information. Spatial information (for 'sf' objects) is preserved.
The function is mainly intended for aggregating covariates to station level.
It does currently not handle camera malfunction (via columns 'ProblemX_from' / 'ProblemX_to')
and does not provide proper handling of problem columns.
Use cameraOperation to aggregate camera trap tables to station level for
analyses while accounting for camera malfunction / problem periods.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.