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)

Arguments

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 TRUE will be included in the result.

include_fun

Include the first element in a call, i.e. the function that will be called.

Value

A list or vector obtained by concatenating the attributes from the arguments.