powered by
The .dot functions creates functions that allows relative-like specification of paths, but are safe from changing working directory.
.dot
.dot(x, root = getwd(), mustExist = FALSE, relative = FALSE, create = TRUE).dot2(names, quiet = FALSE, ...)
.dot2(names, quiet = FALSE, ...)
A function that returns file paths constructed from
root, x, and ....
root
x
...
Side effect: It creates the directory.
File path that is appended to BASEDIR.
BASEDIR
Root of your working directory, from which x is relative too.
Logical value; if TRUE and the resulting path does not exist, it raises an error.
TRUE
For .dot, sets default for the returned function. For the returned function, when TRUE, the function returns a path relative to root.
Logical values, creates the target directory when TRUE (default).
Character vector of names
Logical value, suppresses output to stdout() when TRUE.
Arguments passed on to .dot.
.data <- .dot('data', create=FALSE) .data('input.txt') .data(c('a.txt','b.txt')) .dot2(c('rawdata','results'), create=FALSE) .rawdata('rawfile.csv') .results('myresults.txt')
Run the code above in your browser using DataLab