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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: drgee
> ### Title: Doubly Robust Generalized Estimating Equations
> ### Aliases: drgee coef.drgee vcov.drgee print.drgee summary.drgee
> ###   print.summary.drgee clusterRobustVcov.drgee
> ### Keywords: models regression cluster
> 
> ### ** Examples
> 
> 
> ## DR-estimation when
> ## the main model is
> ## E(Y|A,L1,L2)-E(Y|A=0,L1,L2)=beta0*A+beta1*A*L1
> ## and the outcome nuisance model is
> ## E(Y|A=0,L1,L2)=gamma0+gamma1*L1+gamma2*L2
> ## and the exposure nuisance model is
> ## E(A|Y=0,L1,L2)=expit(alpha0+alpha1*L1+alpha2*l2)
> 
> library(drgee)
> 
> expit<-function(x) exp(x)/(1+exp(x))
> 
> n<-5000
> 
> ## nuisance
> l1<-rnorm(n, mean = 0, sd = 1)
> l2<-rnorm(n, mean = 0, sd = 1)
> 
> beta0<-1.5
> beta1<-1
> gamma0<--1
> gamma1<--2
> gamma2<-2
> alpha0<-1
> alpha1<-5
> alpha2<-3
> 
> ## Exposure generated from the exposure nuisance model
> a<-rbinom(n,1,expit(alpha0 + alpha1*l1 + alpha2*l2))
> ## Outcome generated from the main model and the
> ## outcome nuisance model
> y<-rnorm(n,
+ mean = beta0 * a + beta1 * a * l1 + gamma0 + gamma1 * l1 + gamma2 * l2,
+ sd = 1)
> 
> simdata<-data.frame(y,a,l1,l2)
> 
> ## outcome nuisance model misspecified and
> ## exposure nuisance model correctly specified
> 
> ## DR-estimation
> dr.est <- drgee(oformula = formula(y~l1),
+ eformula = formula(a~l1+l2),
+ iaformula = formula(~l1),
+ olink = "identity", elink = "logit",
+ data = simdata, estimation.method = "dr")
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
drgee
 --- call from context --- 
robustVcov(fit$U, fit$d.U.sum, drgee.data$id.vcov)
 --- call from argument --- 
if (class(inv.d.U) == "try-error") {
    vcov <- matrix(rep(NA, n.par^2), ncol = n.par)
} else {
    vcov <- inv.d.U %*% cov(U, U) %*% t(inv.d.U)/n.clust
}
 --- R stacktrace ---
where 1: robustVcov(fit$U, fit$d.U.sum, drgee.data$id.vcov)
where 2: as.matrix(robustVcov(fit$U, fit$d.U.sum, drgee.data$id.vcov))
where 3: drgee(oformula = formula(y ~ l1), eformula = formula(a ~ l1 + 
    l2), iaformula = formula(~l1), olink = "identity", elink = "logit", 
    data = simdata, estimation.method = "dr")

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (U, d.U.sum, id = NULL) 
{
    n.par <- ncol(d.U.sum)
    n.obs <- nrow(U)
    if (!is.null(id)) {
        n.clust <- length(unique(id))
        if (n.clust != n.obs) {
            U.dt <- as.data.table(cbind(id, U))
            names(U.dt) <- paste(c("id", 1:n.par))
            setkey(U.dt, id)
            U <- as.matrix(U.dt[, lapply(.SD, sum), by = id])[, 
                -1]
        }
    }
    else {
        n.clust <- n.obs
    }
    d.U <- d.U.sum/n.clust
    inv.d.U <- try(solve(d.U))
    if (class(inv.d.U) == "try-error") {
        vcov <- matrix(rep(NA, n.par^2), ncol = n.par)
    }
    else {
        vcov <- inv.d.U %*% cov(U, U) %*% t(inv.d.U)/n.clust
    }
    return(vcov)
}
<bytecode: 0x5643e1b69b58>
<environment: namespace:drgee>
 --- function search by body ---
Function robustVcov in namespace drgee has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1