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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: cov_gen
> ### Title: Generation of covariance matrices
> ### Aliases: cov_gen
> 
> ### ** Examples
> 
>  vcov <- cov_gen(pr_grp_1 = .5, n_fac = 3, n_ind = 2)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
lsasim
 --- call from context --- 
cov_yxw_gen(n_ind, n_z, Phi, n_fac, Lambda)
 --- call from argument --- 
if (class(Lambda) %in% c("numeric", "integer")) {
    Lambda <- lambda_gen(n_ind, n_fac, Lambda, x_names, f_names)
} else {
    dimnames(Lambda) <- list(x_names, f_names)
}
 --- R stacktrace ---
where 1: cov_yxw_gen(n_ind, n_z, Phi, n_fac, Lambda)
where 2: cov_gen(pr_grp_1 = 0.5, n_fac = 3, n_ind = 2)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (n_ind, n_z, Phi, n_fac, Lambda) 
{
    n_ind_rep <- rep(n_ind, n_fac)
    x_names <- paste0("x", 1:sum(n_ind_rep))
    f_names <- paste0("f", 1:length(n_ind_rep))
    w_names <- paste0("w", 1:n_z)
    rownames(Phi) <- colnames(Phi) <- c("y", f_names, w_names)
    l_start <- cumsum(n_ind_rep) - (n_ind_rep - 1)
    l_end <- l_start + n_ind_rep - 1
    n_yxw <- 1 + sum(n_ind_rep) + n_z
    vcov_yxw <- matrix(NA, nrow = n_yxw, ncol = n_yxw)
    rownames(vcov_yxw) <- colnames(vcov_yxw) <- c("y", x_names, 
        w_names)
    if (class(Lambda) %in% c("numeric", "integer")) {
        Lambda <- lambda_gen(n_ind, n_fac, Lambda, x_names, f_names)
    }
    else {
        dimnames(Lambda) <- list(x_names, f_names)
    }
    Phi_f <- Phi[2:(n_fac + 1), 2:(n_fac + 1)]
    cov_x <- Lambda %*% Phi_f %*% t(Lambda)
    var_xf <- Lambda^2 %*% Phi_f + (1 - Lambda^2)
    indicator_vars <- list()
    for (i in seq(n_ind_rep)) {
        indicator_vars[[i]] <- var_xf[l_start[i]:l_end[i], i]
    }
    diag(cov_x) <- unlist(indicator_vars)
    x_indices <- 2:(length(diag(cov_x)) + 1)
    vcov_yxw[x_indices, x_indices] <- cov_x
    for (i in seq(n_ind_rep)) {
        l_seq <- l_start[i]:l_end[i]
        vcov_yxw[1, l_seq + 1] <- Lambda[l_seq, i] * Phi[1, (i + 
            1)]
        vcov_yxw[l_seq + 1, 1] <- t(vcov_yxw[1, l_seq + 1])
    }
    wcol_yxw <- match(w_names, colnames(vcov_yxw))
    wcol_Phi <- match(w_names, colnames(Phi))
    for (i in seq(n_ind_rep)) {
        l_seq <- l_start[i]:l_end[i]
        vcov_yxw[wcol_yxw, l_seq + 1] <- Lambda[l_seq, i] * Phi[wcol_Phi, 
            (i + 1)]
        vcov_yxw[l_seq + 1, wcol_yxw] <- t(vcov_yxw[wcol_yxw, 
            l_seq + 1])
    }
    vcov_yxw[1, wcol_yxw] <- vcov_yxw[wcol_yxw, 1] <- Phi[1, 
        wcol_Phi]
    diag(vcov_yxw) <- 1
    return(vcov_yxw)
}
<bytecode: 0x55e1b9f692c0>
<environment: namespace:lsasim>
 --- function search by body ---
Function cov_yxw_gen in namespace lsasim has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1