context("CCKriging Class")
test_that("objects of class CCKriging are constructed correctly", {
x = data.frame(a = 1:2, b = c("a", "b"))
y = 1:2
cc = makeCCKriging(x = x, y = y, cat.type = "TMC")
expect_is(cc, "CCKriging")
expect_null(cc$par)
expect_error(makeCCKriging(x = 1, y = 1, cat.type = "EC")) # x must be a data.frame
expect_error(makeCCKriging(x = x, y = y, cat.type = "EC", par = 1:4)) # par too long
expect_error(makeCCKriging(x = x, y = y, cat.type = "UC", par = 1)) # par too short
expect_error(makeCCKriging(x = x, y = y, cat.type = "InvalidType", par = 1)) # invalid cat.type
x = data.frame(x, c = c("not a", "factor"))
x$c = as.character(x$c)
expect_error(makeCCKriging(x = x, y = y, cat.type = "EC"), "numeric vector or a factor")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.