Description Usage Arguments Value Examples
View source: R/get_latest_data_file_names.R
Gets the latest downloaded files (in terms of date) from the provided from_directory, as well as the date reflected in the filenames. If no arguments are provided, the directory is assumed to be the '~/Downloads/' folder.
1 | get_latest_data_file_names(from_directory = "~/Downloads/", patterns)
|
from_directory |
A directory where to find the latest data. |
patterns |
A key-value pairs vector containing the label and regex pattern. |
A vector containing key-value pairs where the keys are the labels in 'patterns' and the values are the latest file names according to the patterns.
1 2 3 4 5 6 7 8 9 | dataDict <- 'AnimalIdentification_DataDictionary_2018-07-06.csv'
data <- 'AnimalIdentification_Data_2018-07-06_1604.csv'
write.csv("", file.path(system.file(), dataDict))
write.csv("", file.path(system.file(), data))
patterns <- c("data" = "AnimalIdentification_Data_20\\d\\d.*\\.csv",
"metadata" = "AnimalIdentification_DataDictionary_20\\d\\d.*\\.csv",
"date" = "\\d{4}-\\d{2}-\\d{2}")
get_latest_data_file_names(system.file(), patterns)
file.remove(c(file.path(system.file(), dataDict), file.path(system.file(), data)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.