| orderly_search | R Documentation |
Evaluate a query against the orderly database (within
.outpack/), returning a vector of matching packet ids. Note
that by default this only searches through packets that are
unpacked and available for direct use on this computer; to search
within packets known to other locations (and that we might know
about via their metadata) you will need to use the location,
allow_remote and fetch_metadata arguments.
orderly_search(
expr,
name = NULL,
scope = NULL,
subquery = NULL,
parameters = NULL,
envir = parent.frame(),
location = NULL,
allow_remote = NULL,
fetch_metadata = FALSE,
options = NULL,
root = NULL
)
expr |
The query expression. A |
name |
Optionally, the name of the packet to scope the query on. This
will be intersected with |
scope |
Optionally, a scope query to limit the packets
searched by |
subquery |
Optionally, named list of subqueries which can be
referenced by name from the |
parameters |
Optionally, a named list of parameters to substitute
into the query (using the |
envir |
Optionally, an environment to substitute into the
query (using the |
location |
Optional vector of locations to pull from. We might in future expand this to allow wildcards or exceptions. |
allow_remote |
Logical, indicating if we should allow packets
to be found that are not currently unpacked (i.e., are known
only to a location that we have metadata from). If this is
|
fetch_metadata |
Logical, indicating if we should pull
metadata immediately before the search. If |
options |
DEPRECATED. Please don't use this any more, and
instead use the arguments |
root |
The path to the root directory, or |
A character vector of matching ids. In the case of no
match from a query returning a single value (e.g., latest(...)
or single(...)) this will be a character missing value
(NA_character_)
path <- orderly_example()
# Generate a bunch of packets:
suppressMessages({
orderly_run("data", echo = FALSE, root = path)
orderly_run("depends", echo = FALSE, root = path)
for (n in c(2, 4, 6, 8)) {
orderly_run("parameters", list(max_cyl = n), echo = FALSE, root = path)
}
})
# By default, search returns everything, which is rarely what you want:
orderly_search(root = path)
# Restricting by name is common enough that there's a shortcut for
# it:
orderly_search(name = "data", root = path)
orderly_search(name = "parameters", root = path)
# Restrict to a parameter value:
orderly_search(quote(parameter:max_cyl > 4), name = "parameters",
root = path)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.