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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: node_binomial
> ### Title: Generate Data from a (Mixed) Binomial Regression Model
> ### Aliases: node_binomial
> 
> ### ** Examples
> 
> library(simDAG)
> 
> set.seed(5425)
> 
> # define needed DAG
> dag <- empty_dag() +
+   node("age", type="rnorm", mean=50, sd=4) +
+   node("sex", type="rbernoulli", p=0.5) +
+   node("smoking", type="binomial", parents=c("age", "sex"),
+        betas=c(1.1, 0.4), intercept=-2)
> 
> # define the same DAG, but using a pretty formula
> dag <- empty_dag() +
+   node("age", type="rnorm", mean=50, sd=4) +
+   node("sex", type="rbernoulli", p=0.5) +
+   node("smoking", type="binomial",
+        formula= ~ -2 + age*1.1 + sexTRUE*0.4)
> 
> # simulate data from it
> sim_dat <- sim_from_dag(dag=dag, n_sim=100)
> 
> # returning only the estimated probability instead
> dag <- empty_dag() +
+   node("age", type="rnorm", mean=50, sd=4) +
+   node("sex", type="rbernoulli", p=0.5) +
+   node("smoking", type="binomial", parents=c("age", "sex"),
+        betas=c(1.1, 0.4), intercept=-2, return_prob=TRUE)
> 
> sim_dat <- sim_from_dag(dag=dag, n_sim=100)
> 
> ## an example using a random effect
> if (requireNamespace("simr")) {
+ 
+ library(simr)
+ 
+ dag_mixed <- empty_dag() +
+   node("School", type="rcategorical", probs=rep(0.1, 10),
+        labels=LETTERS[1:10]) +
+   node("Age", type="rnorm", mean=12, sd=2) +
+   node("Grade", type="binomial", formula= ~ -10 + Age*1.2 + (1|School),
+        var_corr=0.3)
+ 
+ sim_dat <- sim_from_dag(dag=dag_mixed, n_sim=100)
+ }
Loading required namespace: simr
Loading required package: lme4
Loading required package: Matrix

Attaching package: ‘simr’

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

    getData

Error: An error occured when processing node 'Grade'. The message was:
Error in mkMerMod(rho, opt, glmod$reTrms, fr = glmod$fr, mc = mcout, lme4conv = cc): unexpected parameter vector length: length(pars)=1, npar=1, nAGQ=1; (expected length(pars)==npar iff nAGQ==0)
Execution halted