Description Usage Arguments Details Value Examples
Add one or more resources to an orderly.yml
file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | orderly_use_resource(
resources,
name = NULL,
root = NULL,
locate = TRUE,
show = TRUE,
edit = TRUE,
prompt = TRUE
)
orderly_use_source(
sources,
name = NULL,
root = NULL,
locate = TRUE,
show = TRUE,
edit = TRUE,
prompt = TRUE
)
orderly_use_package(
packages,
name = NULL,
root = NULL,
locate = TRUE,
show = TRUE,
edit = TRUE,
prompt = TRUE
)
orderly_use_gitignore(
root = NULL,
locate = TRUE,
show = TRUE,
edit = TRUE,
prompt = TRUE
)
|
resources, sources |
Character vector of resources or sources to add. These must be filenames relative to the report directory, must exist, and must not already be present in the orderly.yml |
name |
Name of the report to modify. Like
|
root |
The path to an orderly root directory, or |
locate |
Logical, indicating if the configuration should be
searched for. If |
show |
Logical, indicating if we should print the proposed changes to screen |
edit |
Logical, indicating if we should actually edit the
|
prompt |
Logical, indicating if we should prompt before
editing the orderly.yml file. Only has an effect if |
packages |
Character vector of package names to add. These must not already exist in the orderly.yml |
The orderly_use_gitignore
configures a basic
.gitignore
file at the root of your orderly project that
will prevent files from being added to git. This is only really
useful if you are using (or will use) git, but it is harmless at
worst.
Invisibly, this function returns information about the file it would edit. This information is primarily for debugging purposes and the format is subject to change.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | path <- orderly::orderly_example("minimal")
# Suppose we wanted to use the mtcars data within our report.
# First, the file must exist:
write.csv(mtcars, file.path(path, "src", "example", "mtcars.csv"),
row.names = FALSE)
# Preview expected changes
orderly::orderly_use_resource("mtcars.csv", "example", path, edit = FALSE)
# Modify the orderly.yml file within src/example:
orderly::orderly_use_resource("mtcars.csv", "example", path, prompt = FALSE)
# The result is a file that now has a 'resources' section
# containing our new file
writeLines(readLines(file.path(path, "src", "example", "orderly.yml")))
# (of course, we'd still need to modify the script to use it).
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.