add_event_depths.Rd
Add time (in seconds since tagon and perhaps as datetimes in UTC and/or local timezone) to a tibble or data-frame with regularly sampled data
add_event_depths(x, start_x, z, sampling_rate, start_offset = 0, tagon_time)
input data: vector or data frame with event times as datetimes, or in seconds since tagon. Datetimes are assumed to be UTC.
name (no quotes needed) of variable in x
that gives event times. Not needed if x
is a vector or has only one column.
depth data: sensor data structure, vector, matrix, tibble, or data frame. If not a sensor structure, then sampling_rate
is required. If tibble or df it should have only one column (depth data).
sampling rate of depth in Hz (required if x is not a sensor data structure, and ignored if it is)
time (in seconds) between start of tag recording and the first recorded sample in z
. Ignored (and pulled from metadata) if x
is a sensor data structure. default: 0
string giving the tag recording start time. Can be found in tag_dataset$info$dephist_device_datetime_start. Format: day month year hours minutes seconds. Required if times in x
are datetimes.
A data.frame with the data (one row per event) and additional column depth (in meters) of the animal at the start time of the event. Note: if you want to grab and summarize depth data for longer intervals, consider interval_join
or find_dives
and dive_stats