inst/tinytest/test_gh_issue_11.R

d <- data.frame(
    `a col` = c(1,3,5,7)
  , `b col` = c(NA,2,5,7)
  , check.names=FALSE # so R doesn't replace the space with a '.'.
)

expect_equal(simputation:::get_imputed(`a col` ~ `b col`,d),"a col")
expect_equal(simputation:::get_predictors(`a col` ~ `b col`,d), "b col")

# from the original bug report of Miles McBain
expect_silent(impute_knn(d, `a col` ~ `b col`, k=3))

Try the simputation package in your browser

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

simputation documentation built on June 16, 2022, 5:10 p.m.