tests/testthat/test-predict.R

test_that("predict works", {

  data(freelive2)
  data("mosquito")
  object<-MUVR2:::pls(XRVIP2,YR2)

  ### Need to have same number of observations
  expect_error(  predict(object,Xotu))

  nearZeroVar_object<-nearZeroVar(Xotu)
  Xotu2<-Xotu[,-c(nearZeroVar_object$Position)]
  Yotu2<-Yotu[-nearZeroVar_object$Position]
  object<-MUVR2:::plsda(Xotu2,Yotu2)
  ### Need to have same number of variables
  expect_error(  predict(object,Xotu2[,-1]))
})

Try the MUVR2 package in your browser

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

MUVR2 documentation built on Sept. 16, 2024, 9:06 a.m.