test_that("prediction of abundances works", {
model <- brve(y ~ x1 + x2, effort, data = frogs)
frogs_new <- frogs
frogs_new$x1 <- frogs_new$x1 / 10
frogs_new$x2 <- frogs_new$x2 / 10
# should error
expect_error(
predict(model, newdata = frogs_new, type = "abundance", se.fit = TRUE),
"Cannot fit standard errors in abundance prediction in brve"
)
# make predictions
p <- predict(model, frogs_new, se.fit = FALSE)
expect_true(all(p > 0 ))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.