R/utils.R

Defines functions get_download_ts_from_path get_common_path

Documented in get_common_path

#' get common part of path from excel file path
#' @param xlsx_path character. path to excel file.
#' @return character. common part for all files related to one download, i.e. {timestamp}_impfmonitoring
#' @export 
get_common_path <- function(xlsx_path) {
  return(xlsx_path %>% fs::path_file() %>% fs::path_ext_remove())
}

# get download_ts from xlsx path
get_download_ts_from_path <- function(xlsx_path) {
  common <- xlsx_path %>% fs::path_file() %>% fs::path_ext_remove()
  ts <- lubridate::ymd_hms(common, tz = "Europe/Berlin")
  ts
}
friep/vaccc19de documentation built on Feb. 12, 2021, 11:06 a.m.