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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: correlated.matrix
> ### Title: correlated.matrix
> ### Aliases: correlated.matrix
> 
> ### ** Examples
> 
> mat=correlated.matrix(rho=0.85, sigma=30, mu=10, nspecies=10)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
synchrony
 --- call from context --- 
correlated.matrix(rho = 0.85, sigma = 30, mu = 10, nspecies = 10)
 --- call from argument --- 
if (class(L) != "try-error") {
    community = matrix(rnorm(ntimes * nspecies, sd = 1, mean = 0), 
        nrow = ntimes, ncol = nspecies) %*% L
    community = scale(community, center = TRUE, scale = TRUE) * 
        sigma + mu
    attr(community, "scaled:center") = NULL
    attr(community, "scaled:scale") = NULL
} else {
    community = NA
    warning("Unable to generate desired correlation matrix (leading minor is not positive definite)")
}
 --- R stacktrace ---
where 1: correlated.matrix(rho = 0.85, sigma = 30, mu = 10, nspecies = 10)

 --- value of length: 2 type: logical ---
[1] TRUE TRUE
 --- function from context --- 
function (rho = 0, sigma = 1, mu = 0, ntimes = 200, nspecies = 10) 
{
    if (length(rho) > 1) {
        corr.mat = matrix(NA, nrow = nspecies, ncol = nspecies)
        corr.mat[upper.tri(corr.mat)] = rho
        corr.mat[lower.tri(corr.mat)] = corr.mat[upper.tri(corr.mat)]
    }
    else {
        corr.mat = matrix(rho, nrow = nspecies, ncol = nspecies)
    }
    diag(corr.mat) = 1
    L = try(chol(corr.mat), silent = TRUE)
    if (class(L) != "try-error") {
        community = matrix(rnorm(ntimes * nspecies, sd = 1, mean = 0), 
            nrow = ntimes, ncol = nspecies) %*% L
        community = scale(community, center = TRUE, scale = TRUE) * 
            sigma + mu
        attr(community, "scaled:center") = NULL
        attr(community, "scaled:scale") = NULL
    }
    else {
        community = NA
        warning("Unable to generate desired correlation matrix (leading minor is not positive definite)")
    }
    results = list(rho = rho, sigma = sigma, mu = mu, community = community)
    class(results) = "cormat"
    return(results)
}
<bytecode: 0x555b3a865f08>
<environment: namespace:synchrony>
 --- function search by body ---
Function correlated.matrix in namespace synchrony has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1