orderly_new {orderly} | R Documentation |
Create new report
Description
Create new report, starting from a template. Orderly comes with a set of templates, but projects can bring their own templates; see Details below for how these are configured and discovered by orderly.
Usage
orderly_new(name, root = NULL, locate = TRUE, quiet = FALSE, template = NULL)
Arguments
name |
Name of the new report (will be a directory name). |
root |
The path to an orderly root directory, or |
locate |
Logical, indicating if the configuration should be
searched for. If |
quiet |
Logical, indicating if informational messages should be suppressed. |
template |
The name of a template. If |
Details
To create a custom template, create a directory templates
within your orderly root. Within that directory create
directories containing all the files that you would like a report
to contain. This must contain a file
orderly.yml
but may contain further files (for example, you
might want a default script and Rmd file).
If template
is not given (i.e., is NULL
) then we
look for a template called default
(i.e., stored at
template/default
), then fall back on the system orderly
template.
We first look for a file orderly/template.yml
within the
orderly root. If that is not found, then a copy from the orderly
package is used. This can always be used by using template = "system"
.
Value
The path of the new source directory, invisibly
See Also
orderly_init()
for initialising a new orderly
repository.
Examples
path <- orderly::orderly_example("minimal")
# Create a new report with the name "myreport" in this orderly
# repository:
orderly::orderly_new("myreport", root = path)
# The directory will be initialised with a orderly.yml file
# containing documentation
dir(file.path(path, "src", "myreport"))
readLines(file.path(path, "src", "myreport", "orderly.yml"))