Running examples in ‘DHARMa-Ex.R’ failed
The error most likely occurred in:

> ### Name: refit.glmmTMB
> ### Title: Refit a Model with a Different Response
> ### Aliases: refit.glmmTMB
> 
> ### ** Examples
> 
> testData = createData(sampleSize = 200, family = poisson())
> 
> # examples of refit with different model classes
> library(lme4)
Loading required package: Matrix
> library(mgcv)
Loading required package: nlme

Attaching package: ‘nlme’

The following object is masked from ‘package:lme4’:

    lmList

The following object is masked from ‘package:DHARMa’:

    getResponse

This is mgcv 1.8-31. For overview type 'help("mgcv-package")'.
> library(glmmTMB)
> 
> fittedModel <- lm(observedResponse ~ Environment1 , data = testData)
> newResponse = simulate(fittedModel)
> refit(fittedModel, newResponse[,1])

Call:
lm(formula = observedResponse ~ Environment1, data = newData)

Coefficients:
 (Intercept)  Environment1  
       2.748         2.521  

> 
> fittedModel <- glm(observedResponse ~ Environment1 , data = testData, family = "poisson")
> newResponse = simulate(fittedModel)
> refit(fittedModel, newResponse[,1])

Call:  glm(formula = observedResponse ~ Environment1, family = "poisson", 
    data = newData)

Coefficients:
 (Intercept)  Environment1  
      0.7819        1.0281  

Degrees of Freedom: 199 Total (i.e. Null);  198 Residual
Null Deviance:	    398.7 
Residual Deviance: 230.4 	AIC: 722.9
> 
> fittedModel <- mgcv::gam(observedResponse ~ s(Environment1) , data = testData, family = "poisson")
> newResponse = simulate(fittedModel)
> refit(fittedModel, newResponse[,1])

Family: poisson 
Link function: log 

Formula:
observedResponse ~ s(Environment1)

Estimated degrees of freedom:
2.49  total = 3.49 

UBRE score: 0.1939554     
> 
> fittedModel <- lme4::lmer(observedResponse ~ Environment1 + (1|group) , data = testData)
> newResponse = simulate(fittedModel)
> refit(fittedModel, newResponse[,1])
Linear mixed model fit by REML ['lmerMod']
Formula: observedResponse ~ Environment1 + (1 | group)
   Data: testData
REML criterion at convergence: 973.1087
Random effects:
 Groups   Name        Std.Dev.
 group    (Intercept) 2.823   
 Residual             2.538   
Number of obs: 200, groups:  group, 10
Fixed Effects:
 (Intercept)  Environment1  
       3.142         3.360  
> 
> fittedModel <- lme4::glmer(observedResponse ~ Environment1 + (1|group) , data = testData, 
+                            family = "poisson")
> newResponse = simulate(fittedModel)
> refit(fittedModel, newResponse[,1])
Generalized linear mixed model fit by maximum likelihood (Laplace
  Approximation) [glmerMod]
 Family: poisson  ( log )
Formula: observedResponse ~ Environment1 + (1 | group)
   Data: testData
      AIC       BIC    logLik  deviance  df.resid 
 604.3708  614.2658 -299.1854  598.3708       197 
Random effects:
 Groups Name        Std.Dev.
 group  (Intercept) 0.6745  
Number of obs: 200, groups:  group, 10
Fixed Effects:
 (Intercept)  Environment1  
     0.08398       1.14725  
> 
> fittedModel <- glmmTMB::glmmTMB(observedResponse ~ Environment1 + (1|group) , data = testData)
Error in do.call(`[`, c(list(x), indvecs, if (!is.null(dim(x))) list(drop = FALSE))) : 
  object 'group' not found
Calls: <Anonymous> ... fbx -> fbx -> fbx -> head -> head.default -> do.call
Execution halted