Skip to content

Commit

Permalink
Fix new visreg unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Mar 28, 2024
1 parent 0bd95dd commit 96e1d60
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions tests/testthat/test-1-visreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -185,20 +185,19 @@ test_that("visreg works", {
expect_identical(class(v), "visreg2d")
})


test_that("visreg works with extra time #330", {
skip_on_cran()
library(sdmTMB)
pcod$fyear <- as.factor(pcod$year)
mesh <- make_mesh(pcod, c("X", "Y"), cutoff = 20)
pcod_2011$fyear <- as.factor(pcod_2011$year)
fit <- sdmTMB(
density ~ fyear,
density ~ 0 + depth_scaled,
time = "year",
spatiotemporal = "iid",
data = pcod,
mesh = mesh,
spatial = "off",
spatiotemporal = "off",
time_varying = ~ 1,
data = pcod_2011,
family = tweedie(),
extra_time = 2012
)
visreg::visreg(fit, "fyear")
v <- visreg::visreg(fit, "depth_scaled")
expect_s3_class(v, 'visreg')
})

0 comments on commit 96e1d60

Please sign in to comment.