diff --git a/tests/testthat/SSmase_test.R b/tests/testthat/SSmase_test.R index e6d0f4d..893b116 100644 --- a/tests/testthat/SSmase_test.R +++ b/tests/testthat/SSmase_test.R @@ -1,31 +1,31 @@ ## File is deprecated by MOshima 6/12/23 -#library(ss3diags) +# library(ss3diags) # Tests # sma = r4ss::SSsummarize(retro.sma) # Check joint MASE for indices -#SSmase(retro.sma) +# SSmase(retro.sma) # select indices -#SSmase(retro.sma, indexselect = c(4)) +# SSmase(retro.sma, indexselect = c(4)) # check for length comps # smaL = ss3diags::SSretroComps(retro.sma) -#SSmase(retro.sma, quants = "len", indexselect = 2:4) +# SSmase(retro.sma, quants = "len", indexselect = 2:4) # check manually -#mase <- SSmase(retro.sma, residuals = T) +# mase <- SSmase(retro.sma, residuals = T) # Joint mase from index 1, 3,4 -#mae <- apply( +# mae <- apply( # mase$Residuals[c("Pred.Res", "Naive.Res")], 2, # function(x) mean(abs(x)) -#) +# ) # MASE -#mae[1] / mae[2] +# mae[1] / mae[2] # compare -#SSmase(retro.sma) +# SSmase(retro.sma) # Check hake # phk= r4ss::SSsummarize(retro.phk) -#SSmase(retro.phk, verbose = T, indexselect = 1) +# SSmase(retro.phk, verbose = T, indexselect = 1) # check for age comps -#phkA <- ss3diags::SSretroComps(retro.phk) -#SSmase(retro.phk, quants = "age") +# phkA <- ss3diags::SSretroComps(retro.phk) +# SSmase(retro.phk, quants = "age") diff --git a/tests/testthat/test-HCxval.R b/tests/testthat/test-HCxval.R index 84488bb..e99b5c2 100644 --- a/tests/testthat/test-HCxval.R +++ b/tests/testthat/test-HCxval.R @@ -1,7 +1,7 @@ ## Test script for hindcast cross validation and MASE -#retroSimple <- ss3diags::retroSimple -#retrosum.simple <- r4ss::SSsummarize(retroSimple) +# retroSimple <- ss3diags::retroSimple +# retrosum.simple <- r4ss::SSsummarize(retroSimple) path <- file.path(tempdir(), "test_runs") dir.create(path, showWarnings = FALSE) diff --git a/tests/testthat/test-plotJABBA.R b/tests/testthat/test-plotJABBA.R index 8cf0e57..78644f3 100644 --- a/tests/testthat/test-plotJABBA.R +++ b/tests/testthat/test-plotJABBA.R @@ -1,5 +1,5 @@ ## Test script for JABBA residual plot -simple <- r4ss::SS_output(dir = test_example_path, verbose=FALSE, printstats = FALSE) +simple <- r4ss::SS_output(dir = test_example_path, verbose = FALSE, printstats = FALSE) path <- file.path(tempdir(), "test_runs") dir.create(path, showWarnings = FALSE) @@ -30,19 +30,19 @@ test_that("file of simple_len_jabbaresiduals plot exists", { }) ## CAAL uncomment when con option is finished in function -#test_that("file of simple_con_jabbaresiduals plot exists", { - # - #SSplotJABBAres(simple, - #use_png = TRUE, - #print_plot = TRUE, - #subplots = "con", - #plotdir = path, - #filenameprefix = "simple_con_" - #) - - #expect_true(file.exists(file.path(path, "simple_con_jabbaresidual.png"))) - # -#}) +# test_that("file of simple_con_jabbaresiduals plot exists", { +# +# SSplotJABBAres(simple, +# use_png = TRUE, +# print_plot = TRUE, +# subplots = "con", +# plotdir = path, +# filenameprefix = "simple_con_" +# ) + +# expect_true(file.exists(file.path(path, "simple_con_jabbaresidual.png"))) +# +# }) test_that("calculate RMSE for CPUE index", { rmse <- SSrmse(simple, quants = "cpue") diff --git a/tests/testthat/test-runs-test.R b/tests/testthat/test-runs-test.R index 4dc6ddf..094ad92 100644 --- a/tests/testthat/test-runs-test.R +++ b/tests/testthat/test-runs-test.R @@ -1,4 +1,4 @@ -simple <- r4ss::SS_output(dir = test_example_path, verbose=FALSE, printstats = FALSE) +simple <- r4ss::SS_output(dir = test_example_path, verbose = FALSE, printstats = FALSE) #### Simple Model ############################################################### @@ -127,11 +127,11 @@ test_that("runs test works with simple model", { run_cpue <- SSrunstest(simple, quants = "len", indexselect = 2) expect_match(run_cpue$Index, "SURVEY1") - # CAAL since switching to simple_small, there is no conditional-age-at-length data. - #run_con <- SSrunstest(simple, quants = "con") + # CAAL since switching to simple_small, there is no conditional-age-at-length data. + # run_con <- SSrunstest(simple, quants = "con") - #expect_match(run_con$Index, "Fishery") - #expect_match(run_con$test, "Passed") + # expect_match(run_con$Index, "Fishery") + # expect_match(run_con$test, "Passed") }) diff --git a/tests/testthat/test-uncertainty.R b/tests/testthat/test-uncertainty.R index 04359f1..f8670d7 100644 --- a/tests/testthat/test-uncertainty.R +++ b/tests/testthat/test-uncertainty.R @@ -1,5 +1,5 @@ # Test script for evaluating model uncertainty -simple <- r4ss::SS_output(dir = test_example_path, verbose=FALSE, printstats = FALSE) +simple <- r4ss::SS_output(dir = test_example_path, verbose = FALSE, printstats = FALSE) mvln.msy <- SSdeltaMVLN(simple, Fref = "MSY")