View source: R/return_latest.R
return_latest | R Documentation |
'return_latest' checks for a pattern in a folder and provides the most recent file bases on the time the file was modified
return_latest(folderpath, pattern, quiet = FALSE, ...)
folderpath |
path to folder where file(s) are located. |
pattern |
pattern in file name, regex expressions. If not parttern is provided, the last file in the folder will be returned. |
quiet |
suppresses the output message related to the file name creation, for use in sub functions, default = FALSE |
... |
Any other valid option for 'base::list.files()'. |
a vector of the full filepath for the most recent version of a file stub
## Not run:
file_stub <- "MER_Structured_Datasets_OU_IM_FY18-20"
filepath <- return_latest("Data", file_stub)
df <- read_rds(filepath)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.