From 96e1d60a6db79106edabfb1cfeb98a2fa0d2d822 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Thu, 28 Mar 2024 12:08:56 -0700 Subject: [PATCH] Fix new visreg unit test --- tests/testthat/test-1-visreg.R | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/testthat/test-1-visreg.R b/tests/testthat/test-1-visreg.R index d9999898e..6a3caf3f7 100644 --- a/tests/testthat/test-1-visreg.R +++ b/tests/testthat/test-1-visreg.R @@ -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') })