add_sensor_times.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_sensor_times(
x,
sampling_rate,
start_offset = 0,
add_utc_time = FALSE,
tagon_time
)
input data: sensor data structure, vector, matrix, tibble, or data frame. If x
is not a tag sensor data structure, then sampling_rate
is required input.
sampling rate of x 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. Ignored (and pulled from metadata) if x
is a sensor data structure. default: 0
Logical: should UTC time column be added? Default is FALSE.
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 add_dttm
is TRUE.
A data.frame with the data (one row per sample) and column sec_since_tagon with times in seconds since start of tag recording. Optionally, also includes column utc_time.
# Examples will go here