From ca11eb48fd283b7ca96ef3f3549efb251bb5eea5 Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Tue, 10 Oct 2023 15:42:53 -0700 Subject: [PATCH] Fix smoother parsing with glmmTMB>=1.1.8 #260 #261 --- R/fit.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/fit.R b/R/fit.R index fd58bdb7a..0b36fdfa8 100644 --- a/R/fit.R +++ b/R/fit.R @@ -824,7 +824,8 @@ sdmTMB <- function( contains_offset <- check_offset(formula[[ii]]) # anything in a list here needs to be saved for tmb data - split_formula[[ii]] <- glmmTMB::splitForm(formula[ii][[1]]) + formula_no_sm <- remove_s_and_t2(formula[[ii]]) + split_formula[[ii]] <- glmmTMB::splitForm(formula_no_sm) RE_names <- barnames(split_formula[[ii]]$reTrmFormulas) fct_check <- vapply(RE_names, function(x) check_valid_factor_levels(data[[x]], .name = x), TRUE) @@ -834,7 +835,6 @@ sdmTMB <- function( formula[[ii]] <- split_formula[[ii]]$fixedFormula ln_tau_G_index[[ii]] <- unlist(lapply(seq_along(nobs_RE[[ii]]), function(i) rep(i, each = nobs_RE[[ii]][i]))) - 1L - formula_no_sm <- remove_s_and_t2(formula[[ii]]) X_ij[[ii]] <- model.matrix(formula_no_sm, data) mf[[ii]] <- model.frame(formula_no_sm, data) # Check for random slopes: