diff options
author | Ken Kellner <ken@kenkellner.com> | 2022-08-22 12:38:44 -0400 |
---|---|---|
committer | Ken Kellner <ken@kenkellner.com> | 2022-08-22 12:38:44 -0400 |
commit | 27f104bbd349ecacf704a8e9b3c287b3bedab5d0 (patch) | |
tree | 9f5505a632d7018d23da5036dc91b0051193cb90 | |
parent | a2c9c02a3d219f2c9279f918d77b9f4b41861af3 (diff) |
Make fitLists work with GDR
-rw-r--r-- | DESCRIPTION | 4 | ||||
-rw-r--r-- | R/gdistremoval.R | 5 | ||||
-rw-r--r-- | tests/testthat/test_gdistremoval.R | 5 |
3 files changed, 12 insertions, 2 deletions
diff --git a/DESCRIPTION b/DESCRIPTION index 751cc40..5423c29 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: unmarked -Version: 1.2.5.9004 -Date: 2022-07-27 +Version: 1.2.5.9005 +Date: 2022-08-22 Type: Package Title: Models for Data from Unmarked Animals Authors@R: c( diff --git a/R/gdistremoval.R b/R/gdistremoval.R index bddac3e..43295f4 100644 --- a/R/gdistremoval.R +++ b/R/gdistremoval.R @@ -812,3 +812,8 @@ setMethod("plot", c(x = "unmarkedFitGDR", y = "missing"), function(x, y, ...) main="Removal") abline(h = 0, lty = 3, col = "gray") }) + +# Used with fitList +setMethod("fl_getY", "unmarkedFitGDR", function(fit, ...){ + getDesign(getData(fit), fit@formlist)$yDist +}) diff --git a/tests/testthat/test_gdistremoval.R b/tests/testthat/test_gdistremoval.R index c780643..8f453a5 100644 --- a/tests/testthat/test_gdistremoval.R +++ b/tests/testthat/test_gdistremoval.R @@ -338,6 +338,11 @@ test_that("gdistremoval can fit models",{ pb <- parboot(fit, nsim=2) expect_is(pb, "parboot") + # Fit list construction + fl <- fitList(fits=list(fit1=fit, fit2=fit)) + expect_is(fl, "unmarkedFitList") + ms <- modSel(fl) + expect_is(ms, "unmarkedModSel") }) test_that("gdistremoval predict method works",{ |