View source: R/bru.inference.R
bru_eval_in_data_context | R Documentation |
Evaluate an expression in a series of data contexts, also making the objects directly available as names surrounded by ".", stopping when the expression evaluation completes with no error.
This is an internal inlabru method, not intended for general use.
bru_eval_in_data_context(
input,
data = NULL,
default = NULL,
.envir = parent.frame()
)
input |
An expression to be evaluated |
data |
list of data objects in priority order. Named elements will
be available as |
default |
Value used if the expression is evaluated as NULL. Default NULL |
.envir |
The evaluation environment |
The result of expression evaluation
# The A values come from the 'data' element, and the B values come from
# the 'response_data' element, as that is listed first.
bru_eval_in_data_context(
quote(
list(A = .data.$x, B = x)
),
list(
response_data = tibble::tibble(x = 1:5),
data = tibble::tibble(x = 1:10)
)
)
# Both A and B come from the 'data' element, as 'x' is found there,
# terminating the evaluation attempt.
bru_eval_in_data_context(
quote(
list(A = .data.$x, B = x)
),
list(
data = tibble::tibble(x = 1:10),
response_data = tibble::tibble(x = 1:5)
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.