View source: R/query_explain.R
| orderly_query_explain | R Documentation |
Explain how a query has or has not matched. This is experimental
and the output will change. At the moment, it can tell you why a
query matches, or if fails to match based on one of a number of
&&-ed together clauses.
orderly_query_explain(
expr,
name = NULL,
scope = NULL,
subquery = NULL,
parameters = NULL,
envir = parent.frame(),
location = NULL,
allow_remote = 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
|
root |
The path to the root directory, or |
An object of class orderly_query_explain, which can be
inspected (contents subject to change) and which has a print
method which will show a user-friendly summary of the query
result.
path <- orderly_example()
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)
}
})
# Explain why a query matches some packets:
orderly_query_explain("parameter:max_cyl > 2 && name == 'parameters'",
root = path)
# Or misses:
orderly_query_explain("parameter:max_cyl > 2 && name == 'data'",
root = path)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.