View source: R/eval_conditions.bare.R
eval_conditions | R Documentation |
Evaluate each of a set of logical conditions
within a data frame
x
. This is an internal utility function, not intended to be called
directly by package users.
eval_conditions(x, conditions, NA_condition_value=TRUE)
x |
A data frame. |
conditions |
Character vector. Each element should represent an expression that can be
evaluated within |
NA_condition_value |
Logical scalar, TRUE, FALSE, or NA. The value to use in place of
evaluation when an element of |
Each condition should generally represent an expression involving columns
of x
. It is evaluated using x
as the environment, and must
return either a logical vector with length equal to the number of rows in
x
, or a logical scalar (which will be replicated into a vector of
the right length). The resulting vectors, one per condition, form the
columns of the returned matrix.
A condition may be NA or the empty string. In that case it is not
evaluated, and a vector containing NA_condition_value
is used
instead.
Logical matrix with one row for each row of x
and one column for
each condition in conditions
. Element [i, j]
contains the
result of evaluating condition[j]
for the i
-th row of
x
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.