add_dates_times: Add POSIXct date times and create a regular time series

View source: R/dive_tidy_functions.R

add_dates_timesR Documentation

Add POSIXct date times and create a regular time series

Description

The seal often moved faster than the transducer arm could document the dive, which results in large gaps as the seal is descending/ascending. This function transforms the record into a regular time series, which greatly benefits future spline smoothing and dive analysis. This also transforms the x-axis into POSIXct date times.

Usage

add_dates_times(
  trace,
  start_time,
  on_seal,
  off_seal,
  tz = "Antarctica/McMurdo"
)

Arguments

trace

tidy trace data frame after arc removal, contains the x and y values of the trace.

start_time

time TDR was turned on, in y:m:d h:m:s format.

on_seal

time TDR was placed on the seal, in y:m:d h:m:s format.

off_seal

time TDR taken off the seal, in y:m:d h:m:s format.

tz

time zone to use for POSIXct date times.

Value

trace data frame with POSIXct date times and interpolated points to fill sparse parts of the record.

Examples

## Not run: 
trace <- add_dates_times(trace, start_time = "1981:01:16 15:10:00",
on_seal = "1981:01:16 17:58:00", off_seal = "1981:01:23 15:30:00",
tz = "Antarctica/McMurdo")

## End(Not run)


EmmaLiTsai/recoverKBTDR documentation built on Aug. 29, 2024, 10:38 a.m.