Functions that apply expressions to input data objects and return data frames.

dapc: Apply function to columns of a data frame.

dapr: Apply function to rows of a data frame.

dapc_if: Apply function to certain columns of a data frame.

dapr_if: Apply function to certain rows of a data frame.

dapc(.data, .f, ...)

dapr(.data, .f, ...)

dapc_if(.data, .predicate, .f, ...)

dapr_if(.data, .predicate, .f, ...)

Arguments

.data

Data frame input.

.f

Function to apply to element (columns or rows). This can be written as a single function name e.g., mean, a formula-like function call where '.x' is assumed to be the iterated over element of input data e.g., ~ mean(.x), or an in-line function definition e.g., function(x) mean(x).

...

Other values passed to function call.

.predicate

Logical vector or expression evaluating to a logical vector. If not a logical vector, this can be written as a single function name e.g., is.numeric, a formula-like function call where '.x' is assumed to be the iterated over element of input data e.g., ~ is.numeric(.x), or an in-line function definition e.g., function(x) is.numeric(x). Regardless, if a logical vector is not provided, this expression must return a logical vector of the same length as the input .data object.

The resulting logical vector is used to determine which elements (rows or columns) to iterate over with the .f function/expression.

Value

A data frame

See also