R/a_load_data.R

Defines functions data_fft

Documented in data_fft

#' Load FFT tracking data
#'
#' \code{data_fft} imports the capuchin tracking data.
#'
#' By default, the function expects to be run from the FFT project folder .
#'
#' @param data_path the path to the data file
#'
#' @seealso [fftidy::extend_data()] a less saturated version of the color scheme.
#'
#' @export
data_fft <- function(data_path = "data/fft_capuchins_movebank_download.tsv.gz"){
  vroom::vroom(data_path, delim = "\t") %>%
    dplyr::mutate(timestamp = timestamp %>% lubridate::force_tz("UTC"),
         timestamp_pan = timestamp %>% lubridate::with_tz("EST"),
         field_season = c(2015, 2017)[2-(as.numeric(timestamp < lubridate::ymd_hms("2017-06-01 00:00:00 UTC")))])
}
k-hench/fftidy documentation built on March 9, 2021, 4:10 p.m.