This function moves the working directory to a specified child directory. If the directory does not exist,
the user has the option to create it.
Usage
guide_to_child(child_dir, create = FALSE)
Arguments
- child_dir
A character string specifying the name of the child directory to move into.
- create
A logical value indicating whether to create the child directory if it does not exist. Defaults to `FALSE`.
Value
The new working directory (invisibly) after moving into the child directory.
Details
The function attempts to move the working directory to the specified child directory. If the directory does not exist
and `create` is set to `TRUE`, the directory will be created. If `create` is set to `FALSE`, an error will be thrown
if the directory does not exist.
Examples
if (FALSE) { # \dontrun{
# Move to a child directory named "project"
guides::guide_to_child("project")
# Move to a child directory and create it if it doesn't exist
guides::guide_to_child("project", create = TRUE)
} # }