# Create list of standard folder names and store in a configuration file
conf_file <- tempfile("folders.yml") # Using tempfile() for testing only
folders <- get_folders(conf_file)
# Testing only: Append folder names to parent folder path --
# This would NOT be needed or desired in normal usage
folders <- lapply(folders, function(x) file.path(tempdir(), x))
# Create a folder for each item in "folders" list
result <- create_folders(folders)
# Check results
file.exists(conf_file)
sapply(folders, dir.exists)
# Create a data file and confirm that it exists
df <- data.frame(x = letters[1:3], y = 1:3)
file_path <- here::here(folders$data, "data.csv")
write.csv(df, file_path, row.names = FALSE)
file.exists(file_path)
Run the code above in your browser using DataLab