tests/testthat/test-clm-predict.R

context("Test that clm.predict gives warnings if prevars is absent")

fm1 <- clm(rating ~ temp + contact, data=wine)
newData <- expand.grid(temp=levels(wine$temp),
                       contact=levels(wine$contact))
expect_false(givesWarnings(
    predict(fm1, newdata=newData)
    ))
attr(fm1$terms, "predvars") <- NULL
expect_warning(
    predict(fm1, newdata=newData)
    , "terms object does not have a predvars attribute")

Try the ordinal package in your browser

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

ordinal documentation built on May 2, 2019, 5:47 p.m.