setup_directory {growR} | R Documentation |
Initialize growR directory structure
Description
Creates directories in which growR by default looks for or deposits certain files. Also, optionally populates these directories with example files, which are useful to familiarize oneself with the growR simulation framework.
Usage
setup_directory(root, include_examples = TRUE, force = FALSE)
Arguments
root |
Path to directory in which to initialize. |
include_examples |
If |
force |
boolean If |
Examples
# Prepare a temporary directory to write to
tmp = file.path(tempdir(), "test-setup_directory")
dir.create(tmp)
# We need `force = TRUE` here in order to make the example work in
# non-interactive settings.
setup_directory(root = tmp, include_examples = FALSE, force = TRUE)
# The `input`, `output` and `data` directories are now present.
list.files(tmp)
# Warnings are issued if directories are already present. Example files
# are still copied and potentially overwritten.
setup_directory(root = tmp, include_examples = TRUE, force = TRUE)
# Example files are now present
list.files(tmp, recursive = TRUE)
# End of the example. The following code is for cleaning up.
unlink(tmp, recursive = TRUE)
[Package growR version 1.3.0 Index]