tests/testthat/test_group_parse.R

test_that("Group argument is parsed correctly.", {
    data <- data.frame(x1 = rnorm(10), x2 = rnorm(10), aGroupName = rep(1:2, each = 5))
    form <- fac ~ x1 + x2
    f <- function(f, group, data) {
        .parse_formula(f, substitute(group), data)
    }
    parsed <- f(form, aGroupName, data)
    ## parsed <- .parse_formula(form, aGroupName, data)
    expect_equal(parsed$meta$group$name, "aGroupName")
    expect_s3_class(parsed$meta$group$data, "factor")
})

Try the MIRES package in your browser

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

MIRES documentation built on Feb. 22, 2021, 5:10 p.m.