create_dir()
creates a directory with a specified name.
The user can choose to create another inner directory with the current date as its name.
If the directory already exists, a message is printed.
Examples
# Create a directory with a specified name
create_dir("my_directory", date = FALSE)
#> [1] "my_directory"
unlink("my_directory", recursive = TRUE) # Clean up the created directory
# Create a directory with a specified name and an inner directory with the current date as name
create_dir("my_directory", date = TRUE)
#> [1] "my_directory/2024_09_18"
unlink("my_directory", recursive = TRUE) # Clean up the created directory
# Create a directory inside another directory
create_dir("outer_directory/inner_directory", date = FALSE)
#> [1] "outer_directory/inner_directory"
unlink("outer_directory", recursive = TRUE) # Clean up the created directory
# Create a directory inside a pre existing one
create_dir("outer_directory", date = FALSE)
#> [1] "outer_directory"
create_dir("outer_directory/inner_directory", date = FALSE)
#> [1] "outer_directory/inner_directory"
unlink("outer_directory", recursive = TRUE) # Clean up the created directory