R/clean_data_directory.R

#' clean raw data directory of dated files.
#'
#' @param dir directory where raw data lives
#' @param listToAccess the list of files to access from get_new_additions
#' @inheritParams get_raw_data
#' @return nothing. It saves a single data file and deletes the other files.


clean_data_directory <- function(dir, pattern = "weatherRasterList"){
  list_to_remove <- paste(dir, list.files(dir, pattern), sep = "/")

  do.call(file.remove, list(list_to_remove))


}
one-acre-fund/arc2weather documentation built on May 16, 2019, 5:02 a.m.