Skip to contents

Create a nested directory from root/sub/subsub. If the directory already exists and `alternative = TRUE`, a new directory will be created with an appended numeric suffix.

Usage

create_wd(root, sub, subsub, alternative = F, set = T)

Arguments

root

A character. Root directory (absolute path).

sub

A character. Sub-directory name (not a path).

subsub

A character. Sub-sub-directory name.

alternative

A logical (default: FALSE). If TRUE, appends numeric suffix to avoid overwrite.

set

A logical (default: TRUE). If TRUE, sets the created directory as working directory.

Value

A character string of the final working directory path (only if `set = TRUE`).