Running examples in 'revdbayes-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: plot.evpred
> ### Title: Plot diagnostics for an evpred object
> ### Aliases: plot.evpred
> 
> ### ** Examples
> 
> data(portpirie)
> mat <- diag(c(10000, 10000, 100))
> pn <- set_prior(prior = "norm", model = "gev", mean = c(0,0,0), cov = mat)
> gevp  <- rpost(n = 1000, model = "gev", prior = pn, data = portpirie)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
revdbayes
 --- call from context --- 
gev_mle(gum_init, data = data, m = m, sum_gev = sum_gev)
 --- call from argument --- 
if (class(temp$hessian) == "try-error") {
    temp$cov <- temp$se <- NULL
    return(temp)
}
 --- R stacktrace ---
where 1: gev_mle(gum_init, data = data, m = m, sum_gev = sum_gev)
where 2: (function (data, m = length(data[!is.na(data)]), x1 = min(data, 
    na.rm = TRUE), xm = max(data, na.rm = TRUE), sum_gev = sum(data, 
    na.rm = TRUE), xi_eq_zero = FALSE, init_ests = NULL) 
{
    sr <- sqrt(xm - x1)
    theta_to_phi <- function(theta) {
        phi1 <- theta[1]
        phi2 <- (theta[2] + theta[3] * (x1 - theta[1]))/sr
        phi3 <- (theta[2] + theta[3] * (xm - theta[1]))/sr
        c(phi1, phi2, phi3)
    }
    if (!is.null(init_ests)) {
        return(theta_to_phi(init_ests))
    }
    sigma_init <- stats::sd(data) * sqrt(6)/pi
    mu_init <- mean(data) - sigma_init * 0.577215664901532
    gum_init <- c(mu_init, sigma_init, 0)
    if (xi_eq_zero) {
        init <- gum_init
        init_phi <- theta_to_phi(init)
        fish <- gev_fish(gum_init)
        cov_mtx <- solve(fish)/m
        se <- sqrt(diag(cov_mtx))
        row1 <- c(1, 0, 0)
        row2 <- c(-gum_init[3], 1, x1 - gum_init[1])/sr
        row3 <- c(-gum_init[3], 1, xm - gum_init[1])/sr
        mat <- rbind(row1, row2, row3)
        var_phi <- mat %*% cov_mtx %*% t(mat)
        se_phi <- sqrt(diag(var_phi))
        return(list(init = init, se = se, init_phi = init_phi, 
            se_phi = se_phi))
    }
    ests_ok <- ses_ok <- FALSE
    temp <- gev_mle(gum_init, data = data, m = m, sum_gev = sum_gev)
    init <- temp$mle
    if (init[3] > -1 & !is.infinite(temp$nllh)) {
        ests_ok <- TRUE
        if (init[3] > -0.25 & !is.null(temp$cov)) {
            cov_mtx <- temp$cov
            se <- sqrt(diag_pos(cov_mtx))
            row1 <- c(1, 0, 0)
            row2 <- c(-init[3], 1, x1 - init[1])/sr
            row3 <- c(-init[3], 1, xm - init[1])/sr
            mat <- rbind(row1, row2, row3)
            var_phi <- mat %*% cov_mtx %*% t(mat)
            if (all(diag(var_phi) > 0)) {
                se_phi <- sqrt(diag(var_phi))
                ses_ok <- TRUE
            }
        }
    }
    if (!ests_ok | !ses_ok) {
        pwm <- gev_pwm(data)
        se <- pwm$se
        cov_mtx <- pwm$cov
        row1 <- c(1, 0, 0)
        row2 <- c(-pwm$est[3], 1, x1 - pwm$est[1])/sr
        row3 <- c(-pwm$est[3], 1, xm - pwm$est[1])/sr
        mat <- rbind(row1, row2, row3)
        var_phi <- mat %*% cov_mtx %*% t(mat)
        se_phi <- sqrt(diag(var_phi))
        check <- gev_loglik(pars = pwm$est, data = data, m = m, 
            x1 = x1, xm = xm, sum_gev = sum_gev)
        if (!ests_ok & init[3] > -1 & !is.infinite(check)) {
            init <- pwm$est
            ests_ok <- TRUE
        }
    }
    if (!ests_ok) {
        init <- gev_lrs(data)
        check <- gev_loglik(pars = pwm$est, data = data, m = m, 
            x1 = x1, xm = xm, sum_gev = sum_gev)
        if (init[3] > -1 & !is.infinite(check)) {
            ests_ok <- TRUE
        }
    }
    if (!ests_ok) {
        xbar <- sum_gev/m
        mu <- ((m + 1) * xm/m + xbar)/2
        sigma <- ((m + 1) * xm/m - xbar)/2
        init <- c(mu, sigma, -1)
    }
    init_phi <- theta_to_phi(init)
    return(list(init = init, se = se, init_phi = init_phi, se_phi = se_phi))
})(data = c(4.03, 3.83, 3.65, 3.88, 4.01, 4.08, 4.18, 3.8, 4.36, 
3.96, 3.98, 4.69, 3.85, 3.96, 3.85, 3.93, 3.75, 3.63, 3.57, 4.25, 
3.97, 4.05, 4.24, 4.22, 3.73, 4.37, 4.06, 3.71, 3.96, 4.06, 4.55, 
3.79, 3.89, 4.11, 3.85, 3.86, 3.86, 4.21, 4.01, 4.11, 4.24, 3.96, 
4.21, 3.74, 3.85, 3.88, 3.66, 4.11, 3.71, 4.18, 3.9, 3.78, 3.91, 
3.72, 4, 3.66, 3.62, 4.33, 4.55, 3.75, 4.08, 3.9, 3.88, 3.94, 
4.33), m = 65L, x1 = 3.57, xm = 4.69, sum_gev = 258.74)
where 3: do.call(gev_init, ds)
where 4: rpost(n = 1000, model = "gev", prior = pn, data = portpirie)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (init, ...) 
{
    x <- stats::optim(init, gev_loglik, ..., control = list(fnscale = -1), 
        hessian = FALSE)
    temp <- list()
    temp$mle <- x$par
    temp$nllh <- -x$value
    temp$hessian <- try(stats::optimHess(temp$mle, gev_loglik, 
        ...), silent = TRUE)
    if (class(temp$hessian) == "try-error") {
        temp$cov <- temp$se <- NULL
        return(temp)
    }
    temp$cov <- try(-solve(temp$hessian), silent = TRUE)
    if (class(temp$cov) == "try-error") {
        temp$cov <- temp$se <- NULL
    }
    else {
        temp$se <- sqrt(diag(temp$cov))
    }
    return(temp)
}
<bytecode: 0x3f1d7a8>
<environment: namespace:revdbayes>
 --- function search by body ---
Function gev_mle in namespace revdbayes has this body.
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1