Description Usage Arguments Details Examples
UNLIKE the check_
functions which return checkr_result
objects,
grab_bindings
returns a list with the values matched to the keys.
1 2 3 4 | grab_bindings(ex, ..., key_list = NULL, all_for_one = TRUE,
one_for_all = FALSE)
grab_binding_anywhere(ex, key)
|
ex |
the expression to be searched for the patterns |
... |
the set of patterns. Each pattern must be be enclosed in |
key_list |
specify a set of patterns as a list of quoted expressions, rather than putting them
individually in |
all_for_one |
Logical. If |
one_for_all |
Logical. If |
key |
for |
The patterns in ...
will often have internal commas. To distinquish these
from separate arguments to grab_bindings()
, each pattern must be quoted, e.g. quote(plot(.(one), .(two)))
.
Note that the patterns should include assignment if there is to be any.
1 2 3 4 5 6 7 8 9 10 | ex <- for_checkr(quote(plot(mpg ~ wt, data = subset(mtcars, hp < 150))))
grab_bindings(ex, quote(.(fn)(.(formula), data = .(the_data))))
ex2 <- for_checkr(quote({x <- 1; y <- x^2}))
grab_bindings(ex2, quote(`<-`(x, ..(first))),
quote(`<-`(.(var), .(fn)(x, .(exponent)))), all_for_one = FALSE)
grab_bindings(ex2, quote(`<-`(x, ..(first))),
quote(`<-`(.(var), .(fn)(x, .(exponent)))))
grab_binding_anywhere(for_checkr(quote({4 - 7;sin(3 + 2)})), quote(`+`(.(a), .(b))))
grab_binding_anywhere(for_checkr(quote({4 - 7;sin(3 + 2)})), quote(.(fn)(3 + 2)))
grab_binding_anywhere(for_checkr(quote({4 - 7;sin(3 + 2)})), quote(`-`(.(a), .(b))))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.