add_sites {ARUtools} | R Documentation |
Add site-level data to the metadata
Description
Uses dates to join site-level data (coordinates and site ids) to the meta
data. If the site data have only single dates, then a buffer before and after
is used to determine which recordings belong to that site observation. Can
join by site ids alone if set by_date = NULL
.
Usage
add_sites(
meta,
sites,
buffer_before = 0,
buffer_after = NULL,
by = c("site_id", "aru_id"),
by_date = "date_time",
quiet = FALSE
)
Arguments
meta |
Data frame. Recording metadata. Output of |
sites |
Data frame. Site-level data from |
buffer_before |
Numeric. Number of hours before a deployment in which to
include recordings. |
buffer_after |
Numeric. Number of hours after the deployment in which to
include recordings. |
by |
Character. Columns which identify a deployment in |
by_date |
Character. Date/time type to join data by. |
quiet |
Logical. Whether to suppress progress messages and other non-essential updates. |
Value
A data frame of metadata with site-level data joined in.
Examples
m <- clean_metadata(project_files = example_files)
s <- clean_site_index(example_sites_clean,
name_date = c("date_time_start", "date_time_end")
)
m <- add_sites(m, s)
# Without dates (by site only)
m <- clean_metadata(project_files = example_files)
eg <- dplyr::select(example_sites_clean, -date_time_start, -date_time_end)
s <- clean_site_index(eg, name_date_time = NULL)
m <- add_sites(m, s, by_date = NULL)