metamer (version 0.2.0)

delayed_with: Apply expressions to data.frames

Description

Creates a function that evaluates expressions in a future data.frame. Is like with(), but the data argument is passed at a later step.

Usage

delayed_with(...)

Arguments

...

Expressions that will be evaluated.

Value

A function that takes a data.frame and returns the expressions in ... evaluated in an environment constructed from it.

Details

Each expression in ... must return numeric values. They can be named or return named vectors.

See Also

Other helper functions: densify, draw_data, mean_dist_to, mean_self_proximity, moments_n

Examples

Run this code
# NOT RUN {
some_stats <- delayed_with(mean_x = mean(x), mean(y), sd(x), coef(lm(x ~ y)))
data <- data.frame(x = rnorm(20) , y = rnorm(20))
some_stats(data)

# }

Run the code above in your browser using DataLab