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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: flexPM
> ### Title: Flexible Modeling of Survival Data
> ### Aliases: flexPM
> ### Keywords: models survival
> 
> ### ** Examples
> 
> # Simulated data from a normal distribution 
> 
> n <- 1000
> x1 <- rnorm(n)
> x2 <- runif(n)
> 
> 
> # non-censored, non-truncated data
> 
> t <- rnorm(n, 2 + 3*x1, 1 + x2) # time variable
> m1 <- flexPM(Surv(t) ~ x1 + x2)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
flexPM
 --- call from context --- 
flexPM.newton(c(theta), loglik, maxit = maxit, tol = tol, Bz = Bz, 
    By = By, B1y = B1y, x = x, d = d, d1 = d1, dd = dd, weights = weights, 
    notrunc = notrunc)
 --- call from argument --- 
if (class(H1) != "try-error") {
    if (alg == "gs") {
        alg <- "nr"
        eps <- 1
    }
    delta <- chol2inv(H1) %*% g
} else {
    if (alg == "nr") {
        alg <- "gs"
        eps <- 1
    }
    delta <- g
}
 --- R stacktrace ---
where 1: flexPM.newton(c(theta), loglik, maxit = maxit, tol = tol, Bz = Bz, 
    By = By, B1y = B1y, x = x, d = d, d1 = d1, dd = dd, weights = weights, 
    notrunc = notrunc)
where 2: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
where 3: suppressWarnings(flexPM.newton(c(theta), loglik, maxit = maxit, 
    tol = tol, Bz = Bz, By = By, B1y = B1y, x = x, d = d, d1 = d1, 
    dd = dd, weights = weights, notrunc = notrunc))
where 4: L.estimator(z, y, d, x, weights, df, degree, knots, maxit = maxit, 
    tol = tol, type = type)
where 5: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
where 6: suppressWarnings(L.estimator(z, y, d, x, weights, df, degree, 
    knots, maxit = maxit, tol = tol, type = type))
where 7: flexPM(Surv(t) ~ x1 + x2)

 --- value of length: 2 type: logical ---
[1] TRUE TRUE
 --- function from context --- 
function (start, f, tol = 1e-05, maxit = 200, ...) 
{
    f0 <- f(start, ..., deriv = 2)
    g <- attr(f0, "gradient")
    h <- attr(f0, "hessian")
    conv <- FALSE
    eps <- 1
    alg <- "nr"
    for (i in 1:maxit) {
        if (conv | max(abs(g)) < tol) {
            break
        }
        H1 <- try(chol(h), silent = TRUE)
        if (class(H1) != "try-error") {
            if (alg == "gs") {
                alg <- "nr"
                eps <- 1
            }
            delta <- chol2inv(H1) %*% g
        }
        else {
            if (alg == "nr") {
                alg <- "gs"
                eps <- 1
            }
            delta <- g
        }
        f1 <- Inf
        while (f1 > f0) {
            new.start <- start - delta * eps
            if (max(abs(delta * eps)) < tol) {
                conv <- TRUE
                break
            }
            f1 <- try(f(new.start, ..., deriv = 0), silent = TRUE)
            eps <- eps * 0.5
            if (class(f1) == "try-error" || is.na(f1)) {
                f1 <- Inf
            }
        }
        if (conv | f0 - f1 < tol) {
            break
        }
        f1 <- f(new.start, ..., deriv = 2)
        g1 <- attr(f1, "gradient")
        h1 <- attr(f1, "hessian")
        start <- new.start
        f0 <- f1
        g <- g1
        h <- h1
        eps <- min(eps * 10, 1)
    }
    list(estimate = start, n.it = i, minimum = as.numeric(f0), 
        gradient = g, hessian = h)
}
<bytecode: 0xb66ca10>
<environment: namespace:flexPM>
 --- function search by body ---
Function flexPM.newton in namespace flexPM has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(H1) != "try-error") { : the condition has length > 1
Calls: flexPM
Execution halted