Uses data_date.txt
to create a path with the data date populated.
here_data()
: Returns here::here("secure_data", data_date, ...)
path_data()
: Returns fs::path(path, "secure_data", data_date, ...)
Path components to be appended to the end of the returned path string.
name of data folder. Default is "secure_data"
path to data date folder or file. If folder is passed,
expecting the data date file to be named one of
c("data_date.txt", "data_date", "dataDate.txt", "dataDate")
.
Default value is here::here()
path to folder where data is saved, e.g. fs::path(path, )
Default value is getOption("path_data")
where path_data
can be initialized
at the top of the script with options(path_data = "H:/.../data")
path to data folder
The function expects the user to version their data using a text file indicating
the date the data was last received, and the data to be stored in a corresponding
folder name, e.g. ~/Project Folder/secure_data/2020-01-01
.
if (FALSE) {
here_data()
#> "C:/Users/SjobergD/GitHub/My Project/secure_data/2020-01-01"
here_data("Raw Data.xlsx")
#> "C:/Users/SjobergD/GitHub/My Project/secure_data/2020-01-01/Raw Data.xlsx"
path_data(path = "O:/My Project", "Raw Data.xlsx")
#> "O:/My Project/secure_data/2020-01-01/Raw Data.xlsx"
}