setup_directory | R Documentation |
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.
setup_directory(root, include_examples = TRUE, force = FALSE)
root |
Path to directory in which to initialize. |
include_examples |
If |
force |
boolean If |
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.