View source: R/epi_create_dir.R
epi_create_dir | R Documentation |
This function creates a directory at the specified path, including nested subdirectories if needed.
If the directory already exists, it does nothing. The directory name can include subdirectories (e.g., results/today_xxx/
), and these will be created recursively.
The subdirectory can either be a custom name or the current date (dd_mm_yyyy
format).
epi_create_dir(base_path, subdir = NULL)
base_path |
A character string specifying the base path where the directory will be created. |
subdir |
Optional. A character string specifying the name of the subdirectory. If not provided, the current date will be used. Can include nested paths (e.g., |
The full path to the created or existing directory. Prints a message indicating whether the directory was created or already existed. Also prints the contents.
## Not run:
# Create a directory named with the current date
base_dir <- "path/to/base_directory"
dated_dir <- epi_create_dir(base_dir)
# Create a directory with a custom name
custom_dir <- epi_create_dir(base_dir, subdir = "custom_name")
# Create a nested directory with today's date
nested_dir <- epi_create_dir(base_dir, subdir = "results/today_xxx")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.