confirmdir: confirmdir checks to see if a directory exists and makes it...

View source: R/rutils.R

confirmdirR Documentation

confirmdir checks to see if a directory exists and makes it if not

Description

confirmdir enables one to be sure a selected directory exists. If it has not been created then confirmdir will create it if it does not already exist. This is useful when defining output directories on the hard drive where large objects may be stored.

Usage

confirmdir(x, make = TRUE, verbose = TRUE, ask = TRUE)

Arguments

x

the directory to be checked and created if necessary

make

should the directory be created if it does not already exist? default=TRUE

verbose

should responses be sent to the console? default=TRUE

ask

should confirmdir ask whether to create the directory or not? default = TRUE. Set to FALSE if running a script rather than working interactively.

Value

nothing but it can create a directory

Examples

x <- tempdir()
confirmdir(x)

haddonm/codeutils documentation built on April 15, 2024, 1:02 p.m.