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

> ### Name: plotPredictivenessCurve
> ### Title: Function for predictiveness curve.
> ### Aliases: plotPredictivenessCurve
> ### Keywords: hplot
> 
> ### ** Examples
> # specify dataset with outcome and predictor variables 
> data(ExampleData)
> 
> # fit logistic regression models
> # all steps needed to construct a logistic regression model are written in a function
> # called 'ExampleModels', which is described on page 4-5
> riskmodel1 <- ExampleModels()$riskModel1
> riskmodel2 <- ExampleModels()$riskModel2
> 
> # obtain predicted risks
> predRisk1 <- predRisk(riskmodel1)
> predRisk2 <- predRisk(riskmodel2)
> 
> # specify range of y-axis
> rangeyaxis <- c(0,1) 
> # specify labels of the predictiveness curves
> labels <- c("without genetic factors", "with genetic factors")
> 
> # produce predictiveness curves
> plotPredictivenessCurve(predrisk=cbind(predRisk1,predRisk2),
+ rangeyaxis=rangeyaxis, labels=labels)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
PredictABEL
 --- call from context --- 
plotPredictivenessCurve(predrisk = cbind(predRisk1, predRisk2), 
    rangeyaxis = rangeyaxis, labels = labels)
 --- call from argument --- 
if (class(predrisk) == "numeric") {
    predrisk <- cbind(predrisk)
}
 --- R stacktrace ---
where 1: plotPredictivenessCurve(predrisk = cbind(predRisk1, predRisk2), 
    rangeyaxis = rangeyaxis, labels = labels)

 --- value of length: 2 type: logical ---
[1] FALSE FALSE
 --- function from context --- 
function (predrisk, rangeyaxis, labels, plottitle, xlabel, ylabel, 
    fileplot, plottype) 
{
    if (missing(plottitle)) {
        plottitle <- "Predictiveness curve"
    }
    if (missing(xlabel)) {
        xlabel <- "Cumulative percentage"
    }
    if (missing(ylabel)) {
        ylabel <- "Predicted risks"
    }
    if (missing(rangeyaxis)) {
        rangeyaxis <- c(0, 1)
    }
    if (class(predrisk) == "numeric") {
        predrisk <- cbind(predrisk)
    }
    a <- c(1:dim(predrisk)[2])
    for (i in 1:dim(predrisk)[2]) {
        x <- predrisk[, i]
        if (i == 1) {
            xlim = c(0, 1)
            ylim = c(0, 1)
            xlab = xlabel
            ylab = ylabel
            x <- sort(x)
            n <- length(x)
            y <- (1:n)/n
            z <- y >= ylim[1] & y <= ylim[2]
            resetGraph()
            evalCall(plot, argu = list(x = y[z], y = x[z], type = "n", 
                xlab = "", ylab = "", las = 1, mgp = c(0, 0.6, 
                  0), cex.axis = 1.1, col = 16 + i, lty = i, 
                ylim = rangeyaxis, main = plottitle), checkdef = TRUE, 
                checkpar = TRUE)
            evalCall(lines, argu = list(x = y[z], y = x[z], col = 16 + 
                i, lty = i, lwd = 2), checkdef = TRUE, checkpar = TRUE)
            mtext(xlab, side = 1, line = 2.75, cex = 1.2)
            mtext(ylab, side = 2, line = 2.5, cex = 1.2)
            invisible(data.frame(x = x, y = y))
        }
        else {
            xlim = c(0, 1)
            ylim = c(0, 1)
            x <- sort(x)
            n <- length(x)
            y <- (1:n)/n
            z <- y >= ylim[1] & y <= ylim[2]
            evalCall(lines, argu = list(x = y[z], y = x[z], col = 16 + 
                i, lty = i, lwd = 2, add = TRUE), checkdef = TRUE, 
                checkpar = TRUE)
            mtext(xlab, side = 1, line = 2.75, cex = 1.2)
            mtext(ylab, side = 2, line = 2.5, cex = 1.2)
            invisible(data.frame(x = x, y = y))
        }
    }
    if (!missing(labels)) {
        legend("bottomright", legend = labels, col = c(17:(16 + 
            dim(predrisk)[2])), lty = c(1:(dim(predrisk)[2])), 
            lwd = 2, cex = 1)
    }
    if (missing(plottype)) {
        plottype <- "jpg"
    }
    if (!missing(fileplot)) 
        savePlot(filename = fileplot, type = plottype, device = dev.cur())
}
<bytecode: 0xd519420>
<environment: namespace:PredictABEL>
 --- function search by body ---
Function plotPredictivenessCurve in namespace PredictABEL has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(predrisk) == "numeric") { : 
  the condition has length > 1
Calls: plotPredictivenessCurve
Execution halted