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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: LawTable
> ### Title: Compute Life Tables from Parameters of a Mortality Law
> ### Aliases: LawTable
> 
> ### ** Examples
> 
> # Example 1 --- Makeham --- 4 tables ----------
> x1 = 45:100
> L1 = "makeham"
> C1 = matrix(c(0.00717, 0.07789, 0.00363,
+               0.01018, 0.07229, 0.00001,
+               0.00298, 0.09585, 0.00002,
+               0.00067, 0.11572, 0.00078),
+             nrow = 4, dimnames = list(1:4, c("A", "B", "C")))
> 
> LawTable(x = 45:100, par = C1, law = L1)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
MortalityLaws
 --- call from context --- 
eval(substitute(expr), data, enclos = parent.frame())
 --- call from argument --- 
if (!(K$iclass %in% valid_classes)) {
    stop(paste0("The class of the input should be: ", paste(valid_classes, 
        collapse = ", ")), call. = FALSE)
}
 --- R stacktrace ---
where 1: eval(substitute(expr), data, enclos = parent.frame())
where 2: eval(substitute(expr), data, enclos = parent.frame())
where 3: with.default(input, {
    K <- find.my.case(Dx, Ex, mx, qx, lx, dx)
    C <- K$case
    valid_classes <- c("numeric", "matrix", "data.frame", NULL)
    if (!(K$iclass %in% valid_classes)) {
        stop(paste0("The class of the input should be: ", paste(valid_classes, 
            collapse = ", ")), call. = FALSE)
    }
    SMS <- "contains missing values. These have been replaced with "
    if (!is.null(sex)) {
        if (!(sex %in% c("male", "female", "total"))) 
            stop("'sex' should be: 'male', 'female', 'total' or 'NULL'.", 
                call. = FALSE)
    }
    if (C == "C1_DxEx") {
        Dx[is.na(Dx)] <- 0
        Ex[is.na(Ex) | Ex == 0] <- 0.01
        if (any(is.na(Dx))) 
            warning("'Dx'", SMS, 0, call. = FALSE)
        if (any(is.na(Ex))) 
            warning("'Ex'", SMS, 0.01, call. = FALSE)
    }
    if (C == "C2_mx") {
        mx <- uxAbove100(x, mx)
    }
    if (C == "C3_qx") {
        qx <- uxAbove100(x, qx)
    }
    if (C == "C4_lx") {
        lx[is.na(lx) & x >= 100] <- 0
        if (any(is.na(lx))) 
            warning("'lx'", SMS, 0, call. = FALSE)
    }
    if (C == "C5_dx") {
        dx[is.na(dx)] <- 0
        if (any(is.na(dx))) 
            warning("'dx'", SMS, 0, call. = FALSE)
    }
    if (!is.null(ax)) {
        if (!is.numeric(ax)) 
            stop("'ax' must be a numeric scalar (or NULL)", call. = FALSE)
        if (!any(length(ax) %in% c(1, length(x)))) 
            stop("'ax' must be a scalar of lenght 1 or a ", "vector of the same dimension as 'x'", 
                call. = FALSE)
    }
    out <- list(x = x, Dx = Dx, Ex = Ex, mx = mx, qx = qx, lx = lx, 
        dx = dx, sex = sex, lx0 = lx0, ax = ax, iclass = K$iclass, 
        nLT = K$nLT, LTnames = K$LTnames)
    return(out)
})
where 4: with(input, {
    K <- find.my.case(Dx, Ex, mx, qx, lx, dx)
    C <- K$case
    valid_classes <- c("numeric", "matrix", "data.frame", NULL)
    if (!(K$iclass %in% valid_classes)) {
        stop(paste0("The class of the input should be: ", paste(valid_classes, 
            collapse = ", ")), call. = FALSE)
    }
    SMS <- "contains missing values. These have been replaced with "
    if (!is.null(sex)) {
        if (!(sex %in% c("male", "female", "total"))) 
            stop("'sex' should be: 'male', 'female', 'total' or 'NULL'.", 
                call. = FALSE)
    }
    if (C == "C1_DxEx") {
        Dx[is.na(Dx)] <- 0
        Ex[is.na(Ex) | Ex == 0] <- 0.01
        if (any(is.na(Dx))) 
            warning("'Dx'", SMS, 0, call. = FALSE)
        if (any(is.na(Ex))) 
            warning("'Ex'", SMS, 0.01, call. = FALSE)
    }
    if (C == "C2_mx") {
        mx <- uxAbove100(x, mx)
    }
    if (C == "C3_qx") {
        qx <- uxAbove100(x, qx)
    }
    if (C == "C4_lx") {
        lx[is.na(lx) & x >= 100] <- 0
        if (any(is.na(lx))) 
            warning("'lx'", SMS, 0, call. = FALSE)
    }
    if (C == "C5_dx") {
        dx[is.na(dx)] <- 0
        if (any(is.na(dx))) 
            warning("'dx'", SMS, 0, call. = FALSE)
    }
    if (!is.null(ax)) {
        if (!is.numeric(ax)) 
            stop("'ax' must be a numeric scalar (or NULL)", call. = FALSE)
        if (!any(length(ax) %in% c(1, length(x)))) 
            stop("'ax' must be a scalar of lenght 1 or a ", "vector of the same dimension as 'x'", 
                call. = FALSE)
    }
    out <- list(x = x, Dx = Dx, Ex = Ex, mx = mx, qx = qx, lx = lx, 
        dx = dx, sex = sex, lx0 = lx0, ax = ax, iclass = K$iclass, 
        nLT = K$nLT, LTnames = K$LTnames)
    return(out)
})
where 5: LifeTable.check(input)
where 6: LifeTable(xx, mx = hx, sex = sex, lx0 = lx0, ax = ax)
where 7: LawTable(x = 45:100, par = C1, law = L1)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
 --- function search by body ---
 ----------- END OF FAILURE REPORT -------------- 
Fatal error: the condition has length > 1