Description Usage Arguments Format Value See Also Examples
Manipulate directory tree.
1 |
dir |
directory path to check |
An object of class R6ClassGenerator
of length 24.
no any return value. stop if any error.
Try 'example(DirTree, ask = FALSE)'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | dirTree <- DirTree$new() # create 'plots/'
dirTree$enter("foo") # create 'plots/01_foo/'
png(dirTree$get("rnorm10")) # got 'plots/01_foo/01_rnorm10.png'
plot(rnorm(10), ask = FALSE)
dev.off()
dirTree$leave()
dirTree$enter("bar") # create 'plots/02_bar/'
dirTree$enter("sub1") # create 'plots/02_bar/01_sub1/'
jpeg(dirTree$get("sin", ".jpg")) # got 'plots/02_bar/01_sub1/01_sin.jpg'
plot(sin, 0, 2 * pi, ask = FALSE)
dev.off()
dirTree$leave()
dirTree$enter("sub2") # create 'plots/02_bar/02_sub2/'
f <- dirTree$get("mtcars", ".csv") # got 'plots/02_bar/02_sub2/01_mtcars.csv'
write.csv(mtcars, f)
dirTree$leave()
dirTree$leave()
dirTree$exit() # safely exit
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.