R/helpers.R
collect_from_args.Rd
Given a call expression expr
, this function scans the arguments to the
call and extracts the attribute attribute
from each where the
condition
predicate evaluates to TRUE
, and it concatenates all these.
collect_from_args(expr, attribute, condition = function(expr) TRUE, include_fun = FALSE)
expr | The expression to process. |
---|---|
attribute | The attribute we want to collect from the arguments. |
condition | A predicate. Only arguments where the condition evaluates to
|
include_fun | Include the first element in a call, i.e. the function that will be called. |
A list or vector obtained by concatenating the attributes from the arguments.