rdirs: Recursive Directory Creation

Description Usage Arguments Value See Also Examples

Description

Allows the user to input pieces of directory names to quickly generate multiple sub-directories with similar names nested in the same directory.

Usage

1
rdirs(..., path = getwd(), sep = "_", pad.num = TRUE, text.only = FALSE)

Arguments

path

A character vector specifying the root directory path.

sep

A character string to separate the terms.

pad.num

logical. If TRUE numbers will be padded with leading zeros (detects numeric strings supplied using the colon(:) operator or combine (c() function.

text.only

logical. If TRUE rdirs does not create the directories, but only returns the names. This allows the names to be passed to new_report and presentation.

...

The pieces of the names to put together. rdirs will use R's recylcing rule with different length vectors.

Value

Generates recursive sub directories. Invisibly returns the names of the sub-directories.

See Also

folder, delete, dir.create

Examples

1
2
3
4
5
6
7
8
9
## fx <- folder(delete_me)
## owd <- getwd(); setwd(fx)
## rdirs(admin, 1:15, c("d", "f", "w"), c(1, 4, 6))
rdirs(admin, 1:15, c("d", "f", "w"), c(1, 4, 6), text.only = TRUE)
## rdirs(session, 1:12, seq(as.Date("2000/1/1"), by = "month", length.out = 12))

x <- rdirs(admin, 1:15, c("d", "f", "w"), c(1, 4, 6), text.only = TRUE)
## lapply(x, new_report)
## setwd(owd); delete(fx)

trinker/reports documentation built on May 31, 2019, 9:51 p.m.