tests/testthat/test_X_decomp.R

test_that("Matrix decomposition is orthogonal ?", {
  des1 = cbind(1, rep(0:1, 5))
  d1 = X_decomp(des1)
  x1 = cbind(d1$Xd, d1$Xhe)
  expect_equal(x1 %*% t(x1), diag(ncol(x1)))
})

Try the randRotation package in your browser

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

randRotation documentation built on April 14, 2021, 6:01 p.m.