R/wb_repo_url.R

Defines functions wb_repo_url

Documented in wb_repo_url

#' wb_repo_url
#'
#' @param date date for which to get repo url
#'
#'
wb_repo_url <-
  function(date) {
  # available checkpoints
  checkpoint_dates <- checkpoint::getValidSnapshots()

  # determine nearest available date
  min_date <- min(checkpoint_dates[checkpoint_dates > date])

  repo_url <- paste0(checkpoint::mranUrl(), min_date)
}
petermeissner/wayback documentation built on Oct. 3, 2020, 6:01 a.m.