Skip to content

Commit

Permalink
avoid complete failure if vcov is NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
stemangiola committed Sep 16, 2023
1 parent f65d233 commit 0b395c4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions R/glmmSeq.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,14 @@ glmmTMBcore = function (geneList, fullFormula, reduced, data, family, control,
if (!inherits(fit, "try-error")) {
singular <- conv <- NA
stdErr <- suppressWarnings(coef(summary(fit))$cond[, 2])

vcov. <- vcov(fit)$cond

if(vcov. |> as.numeric() |> is.nan() |> all())
return(list(stats = NA, coef = NA, stdErr = NA, chisq = NA,
df = NA, predict = NA, optinfo = NA, ci_random_effect_df = NA,
message = "vcov. failed to calculate", tryErrors = fit[1]))

fixedEffects <- glmmTMB::fixef(fit)$cond
disp <- glmmTMB::sigma(fit)
msg <- fit$fit$message
Expand Down

0 comments on commit 0b395c4

Please sign in to comment.