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

> ### Name: Model
> ### Title: A GLMM Model
> ### Aliases: Model
> 
> ### ** Examples
> 
> 
> ## ------------------------------------------------
> ## Method `Model$new`
> ## ------------------------------------------------
> 
> ## Don't show: 
> setParallel(FALSE) 
> ## End(Don't show)
> # For more examples, see the examples for MCML.
> 
> #create a data frame describing a cross-sectional parallel cluster
> #randomised trial
> df <- nelder(~(cl(10)*t(5)) > ind(10))
> df$int <- 0
> df[df$cl > 5, 'int'] <- 1
> mod <- Model$new(
+   formula = ~ factor(t) + int - 1 + (1|gr(cl)) + (1|gr(cl,t)),
+   data = df,
+   family = stats::gaussian()
+ )
> 
> # We can also include the outcome data in the model initialisation. 
> # For example, simulating data and creating a new object:
> df$y <- mod$sim_data()
> 
> mod <- Model$new(
+   formula = y ~ factor(t) + int - 1 + (1|gr(cl)) + (1|gr(cl,t)),
+   data = df,
+   family = stats::gaussian()
+ )
> 
> # Here we will specify a cohort study
> df <- nelder(~ind(20) * t(6))
> df$int <- 0
> df[df$t > 3, 'int'] <- 1
> 
> des <- Model$new(
+   formula = ~ int + (1|gr(ind)),
+   data = df,
+   family = stats::poisson()
+ )
>   
> # or with parameter values specified
>   
> des <- Model$new(
+   formula = ~ int + (1|gr(ind)),
+   covariance = c(0.05),
+   mean = c(1,0.5),
+   data = df,
+   family = stats::poisson()
+ )
> 
> #an example of a spatial grid with two time points
> 
> df <- nelder(~ (x(10)*y(10))*t(2))
> spt_design <- Model$new(formula = ~ 1 + (1|ar0(t)*fexp(x,y)),
+                         data = df,
+                         family = stats::gaussian())
> 
> ## ------------------------------------------------
> ## Method `Model$sim_data`
> ## ------------------------------------------------
> 
> df <- nelder(~(cl(10)*t(5)) > ind(10))
> df$int <- 0
> df[df$cl > 5, 'int'] <- 1
> ## Don't show: 
> setParallel(FALSE) # for the CRAN check
> ## End(Don't show)
> des <- Model$new(
+   formula = ~ factor(t) + int - 1 + (1|gr(cl)*ar0(t)),
+   covariance = c(0.05,0.8),
+   mean = c(rep(0,5),0.6),
+   data = df,
+   family = stats::binomial()
+ )
> ysim <- des$sim_data()
> 
> ## ------------------------------------------------
> ## Method `Model$update_parameters`
> ## ------------------------------------------------
> 
> ## Don't show: 
> setParallel(FALSE) # for the CRAN check
> ## End(Don't show)
> df <- nelder(~(cl(10)*t(5)) > ind(10))
> df$int <- 0
> df[df$cl > 5, 'int'] <- 1
> des <- Model$new(
+   formula = ~ factor(t) + int - 1 + (1|gr(cl)*ar0(t)),
+   data = df,
+   family = stats::binomial()
+ )
> des$update_parameters(cov.pars = c(0.1,0.9))
> 
> ## ------------------------------------------------
> ## Method `Model$power`
> ## ------------------------------------------------
> 
> ## Don't show: 
> setParallel(FALSE) # for the CRAN check
> ## End(Don't show)
> df <- nelder(~(cl(10)*t(5)) > ind(10))
> df$int <- 0
> df[df$cl > 5, 'int'] <- 1
> des <- Model$new(
+   formula = ~ factor(t) + int - 1 + (1|gr(cl)) + (1|gr(cl,t)),
+   covariance = c(0.05,0.1),
+   mean = c(rep(0,5),0.6),
+   data = df,
+   family = stats::gaussian(),
+   var_par = 1
+ )
> des$power() #power of 0.90 for the int parameter
      Value         SE     Power
b_t1    0.0 0.07232071 0.0250000
b_t2    0.0 0.06820538 0.0250000
b_t3    0.0 0.06997682 0.0250000
b_t4    0.0 0.07174952 0.0250000
b_t5    0.0 0.07352164 0.0250000
b_int   0.6 0.08534418 0.9999998
> 
> ## ------------------------------------------------
> ## Method `Model$fit`
> ## ------------------------------------------------
> 
> # Simulated trial data example using REML
> set.seed(123)
> data(SimTrial,package = "glmmrBase")
> fit1 <- Model$new(
+   formula = y ~ int + factor(t) - 1 + (1|grlog(cl)*ar0log(t)),
+   data = SimTrial,
+   family = gaussian()
+ )$fit(reml = TRUE)
Error: Exponent fail: nan^1.000000
Execution halted