Hi Scott,
This is due to an internal change in unmarked in version 1.5.1 that results in an incompability with AICcmodavg. One short-term solution is to revert to the previous version of unmarked (1.5.0). Alternatively, I've attached a patch file. If you load unmarked and AICcmodavg, then run
source("patch.R")
The modavg function should work again. I'll work on a permanent fix.
Ken
On Fri, Oct 10, 2025 at 07:42:52AM -0700, 'Scott Pearson' via unmarked wrote:
> I am seeing a new error with R ver. 4.5.1 when using *modavg()* to compute
> model averaged parameter estimates from a set of *colext()* models. Here
> is example code from the *modavg* help page that now throws the error:
> ---------
> library(AICcmodavg) # ver. 2.3-4
> require(unmarked) # ver. 1.5.1
>
> data(frogs)
> umf <- formatMult(masspcru)
> obsCovs(umf) <- scale(obsCovs(umf))
> siteCovs(umf) <- rnorm(numSites(umf))
> yearlySiteCovs(umf) <- data.frame(year = factor(rep(1:7,
> numSites(umf))))
>
> fm <- colext(psiformula = ~ 1, gammaformula = ~ 1, epsilonformula = ~ 1,
> pformula = ~ JulianDate + I(JulianDate^2), data = umf,
> control = list(trace=1, maxit=1e4))
>
> fm.yearly <- colext(psiformula = ~ 1, gammaformula = ~ year,
> epsilonformula = ~ year,
> pformula = ~ JulianDate + I(JulianDate^2),
> data = umf)
>
> Cand.mods <- list(fm, fm.yearly)
> Modnames <- c("psi1(.)gam(.)eps(.)p(Date + Date2)",
> "psi1(.)gam(Year)eps(Year)p(Date + Date2)")
>
> modavg(cand.set = Cand.mods, modnames = Modnames, parm = "(Intercept)",
> parm.type = "psi")
>
> *# Error in FUN(X[[i]], ...) : # no slot of name "psiformula" for this
> object of class "unmarkedFitColExt"*
>
> modavg(cand.set = Cand.mods, modnames = Modnames,
> parm = "I(JulianDate^2)", parm.type = "detect")
>
> *# Error in FUN(X[[i]], ...) : # no slot of name "detformula" for this
> object of class "unmarkedFitColExt"*
> ---------
> Thanks for any advice,
> Scott P.
>
> --
> *** Three hierarchical modeling email lists ***
> (1) unmarked (this list): for questions specific to the R package unmarked
> (2) SCR: for design and Bayesian or non-bayesian analysis of spatial capture-recapture
> (3) HMecology: for everything else, especially material covered in the books by Royle & Dorazio (2008), Kéry & Schaub (2012), Kéry & Royle (2016, 2021) and Schaub & Kéry (2022)
> ---
> You received this message because you are subscribed to the Google Groups "unmarked" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
unmarked+u...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/unmarked/16a7c0bd-ebfb-452f-aff3-d8d846e443e2n%40googlegroups.com.