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

> ### Name: DecisionAnalysis-package
> ### Title: DecisionAnalysis: Multi-Objective Decision Analysis
> ### Aliases: DecisionAnalysis DecisionAnalysis-package
> 
> ### ** Examples
> 
> 
> #Create a value hierarchy tree
> branches<- as.data.frame(matrix(ncol=5,nrow=7))
> names(branches)<-c("Level1","Level2","Level3","leaves","weights")
> branches[1,]<-rbind("QB","Elusiveness","Speed","Forty","0.092")
> branches[2,]<-rbind("QB","Elusiveness","Agility","Shuttle","0.138")
> branches[3,]<-rbind("QB","Size","","Height","0.096")
> branches[4,]<-rbind("QB","Size","","Weight","0.224")
> branches[5,]<-rbind("QB","Intelligence","","Wonderlic","0.07")
> branches[6,]<-rbind("QB","Strength","Explosiveness","Vertical","0.152")
> branches[7,]<-rbind("QB","Strength","Power","Broad","0.228")
> value_hierarchy_tree(branches$Level1,branches$Level2,branches$Level3,
+ leaves=branches$leaves,weights=branches$weights)
> 
> 
> #subset NFLcombine data from DecisionAnalysis package
> qbdata <- NFLcombine[1:7,]
> 
> #Create SAVF_matrix
> Height <- SAVF_exp_score(qbdata$heightinchestotal, 68, 75.21, 82)
> Weight <- SAVF_exp_score(qbdata$weight, 185, 224.34, 275)
> Forty <- SAVF_exp_score(qbdata$fortyyd, 4.3, 4.81, 5.4, increasing=FALSE)
> Shuttle <- SAVF_exp_score(qbdata$twentyss, 3.8, 4.3, 4.9, increasing=FALSE)
> Vertical <- SAVF_exp_score(qbdata$vertical, 21, 32.04, 40)
> Broad <- SAVF_exp_score(qbdata$broad, 90, 111.24, 130)
> Wonderlic <- SAVF_exp_score(qbdata$wonderlic, 0, 27.08, 50)
> SAVF_matrix = cbind(Height, Weight, Forty, Shuttle, Vertical, Broad, Wonderlic)
> 
> #Create weights vector
> weights = c(0.096, 0.224, 0.092, 0.138, 0.152, 0.228, 0.07)
> 
> #Calculate MAVF Score
> MAVF_Scores(SAVF_matrix, weights, qbdata$name)
 ----------- FAILURE REPORT -------------- 
 --- failure: the condition has length > 1 ---
 --- srcref --- 
: 
 --- package (from environment) --- 
DecisionAnalysis
 --- call from context --- 
MAVF_Scores(SAVF_matrix, weights, qbdata$name)
 --- call from argument --- 
if (class(SAVF_matrix) != "matrix") {
    stop("SAVF_matrix must be a matrix\n", "You have provided an object of the following class:\n", 
        "SAVF_matrix: ", class(SAVF_matrix), "\n")
}
 --- R stacktrace ---
where 1: MAVF_Scores(SAVF_matrix, weights, qbdata$name)

 --- value of length: 2 type: logical ---
[1] FALSE  TRUE
 --- function from context --- 
function (SAVF_matrix, weights, names) 
{
    if (class(SAVF_matrix) != "matrix") {
        stop("SAVF_matrix must be a matrix\n", "You have provided an object of the following class:\n", 
            "SAVF_matrix: ", class(SAVF_matrix), "\n")
    }
    if (class(weights) != "matrix") {
        if (class(weights) != "numeric") {
            stop("weights must be of class numeric\n", "You have provided an object of the following class:\n", 
                "weights: ", class(weights))
        }
        if (sum(weights) < 1) {
            warning("The sum of weights is less than 1")
        }
        if (sum(weights) > 1) {
            warning("The sum of weights is greater than 1")
        }
        if (ncol(SAVF_matrix) != length(weights)) {
            stop("The number of columns in the SAVF matrix must equal the length of the vector of weights")
        }
        if (nrow(SAVF_matrix) != length(names)) {
            stop("The number of rows in the SAVF matrix must equal the length of the vector of names")
        }
    }
    SAVF_matrix[is.na(SAVF_matrix)] <- 0
    MAVF = SAVF_matrix %*% weights
    value <- data.frame(names, MAVF)
    names(value) <- c("Name", "Score")
    value <- value[order(value$Score, decreasing = TRUE), ]
    return(value)
}
<bytecode: 0x752d670>
<environment: namespace:DecisionAnalysis>
 --- function search by body ---
Function MAVF_Scores in namespace DecisionAnalysis has this body.
 ----------- END OF FAILURE REPORT -------------- 
Error in if (class(SAVF_matrix) != "matrix") { : 
  the condition has length > 1
Calls: MAVF_Scores
Execution halted