tests/testthat/test-buildXmat-output.R

context("Building the design matrix")
x = rnorm(5)
test_that("buildXmat does the same as model.matrix",{
    expect_equivalent(model.matrix(~I(x)+I(x^2)),
                    buildXmat(x, 3))
    expect_equivalent(model.matrix(~I(x)+I(x^2)+I(x^3)),
                    buildXmat(x, 4))
    expect_equivalent(model.matrix(~I(x)+I(x^2)+I(x^3)+I(x^4)),
                    buildXmat(x, 5))
          })

Try the SPsimSeq package in your browser

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

SPsimSeq documentation built on Nov. 8, 2020, 5:09 p.m.