tests/testthat/test_fapply.R

context("fapply")

formulas = subformula(mpg ~ cyl + disp + hp + drat, protected = ~ cyl)

fapply_object = fapply(formulas, model = lm, data = mtcars, x = TRUE)
AICs = sapply(fapply(formulas, model = lm, data = mtcars, x = TRUE), AIC)
expect_equal(length(AICs), 8)
expect_equal(names(fapply_object), sapply(formulas, formula_to_character))

Try the subformula package in your browser

Any scripts or data that you put into this service are public.

subformula documentation built on Nov. 16, 2019, 1:07 a.m.