tests/testthat/test_encodeX.R

library(latentcor)

test_that("Always recode binary/ternary/truncated", {
  types = c("con", "bin", "tru", "ter")
  X = gen_data(types = types)$X; X[sample(length(X), 10)] = NA
  expect_equal(encodeX(X = cbind(X[ , 1], X[ , 2:4] - 5), types = types)$X, X)
})
mingzehuang/latentcor documentation built on Oct. 2, 2022, 5:49 p.m.