rbchan / unmarked

R package for hierarchical models in ecological research
https://rbchan.github.io/unmarked/
37 stars 25 forks source link

colext example fails under R 4.0 #151

Closed kenkellner closed 4 years ago

kenkellner commented 4 years ago

CRAN is complaining about an example that doesn't run under R-devel: https://cran.r-project.org/web/checks/check_results_unmarked.html

The relevant line is here: https://github.com/rbchan/unmarked/blob/c3e99b81984269ce6b8a3f39e763c1bf213d3187/R/unmarkedFrame.R#L315

And from the R-devel changelog, I think this is the reason:

matrix objects now also inherit from class "array", namely, e.g., class(diag(1)) is c("matrix", "array") which invalidates code assuming that length(class(obj)) == 1, an incorrect assumption that is less frequently fulfilled now.

Should be an easy fix, I can take a look this weekend probably.

kenkellner commented 4 years ago

Other places that need to be updated to new guidelines:

https://github.com/rbchan/unmarked/blob/81d0ed54b8fd86ab0027f821769cb80051d80786/R/unmarkedFitList.R#L97

https://github.com/rbchan/unmarked/blob/81d0ed54b8fd86ab0027f821769cb80051d80786/inst/unitTests/runit.occuFP.R#L22

https://github.com/rbchan/unmarked/blob/5289feb72284da2b32a3da9e98fa9514f618da6b/R/gpcount.R#L124

https://github.com/rbchan/unmarked/blob/c3e99b81984269ce6b8a3f39e763c1bf213d3187/R/boot.R#L26

https://github.com/rbchan/unmarked/blob/8625ad521fa5f4e8609453b772f71d0229fb1db6/R/occuMulti.R#L6

https://github.com/rbchan/unmarked/blob/c3d8bc380d336ed209a120052aa8808bc2492d71/R/gdistsamp.R#L422

https://github.com/rbchan/unmarked/blob/6c4f57374aee79daabe8bfad5813453f7011f44f/R/pcountOpen.R#L178

https://github.com/rbchan/unmarked/blob/845155cd8619dac138f5046202f129a89233c63c/R/occuMS.R#L8

https://github.com/rbchan/unmarked/blob/5289feb72284da2b32a3da9e98fa9514f618da6b/R/distsamp.R#L252

https://github.com/rbchan/unmarked/blob/589e2bd8c578f9be953dd3604a8002dd5bbc11d0/R/gmultmix.R#L160