[R] How to apply calculations in "formula" to "data frame"
Sören Vogel
soeren.vogel at posteo.ch
Tue Mar 28 16:14:26 CEST 2017
Hello
Ho can I apply a formula to a data frame?
library("formula.tools")
Data <- data.frame("v1" = rnorm(31), "v2" = runif(31), "v3" = sample(1:7, 31, repl=T), "v4" = rlnorm(31))
For1 <- as.formula(v1 ~ .^3)
Lhs <- Data[, formula.tools::lhs.vars(formula)]
Rhs <- apply_formula_to_data_frame_and_return_result(data, formula) # ???
Thank you,
Sören
More information about the R-help
mailing list