Checks and creates a directory recursively automatically.

initDir(dir)

Arguments

dir

character(1). Directory path.

Value

character(1). Directory path.

Details

Useful for setting up functions that require writes to a user-specified directory.

Examples

initDir("testdir")
#> [1] "/home/mike/acidbase/packages/brio/docs/reference/testdir"
dir.exists("testdir")
#> [1] TRUE
## Clean up. unlink("testdir", recursive = TRUE)