* using log directory ‘/data/gannet/ripley/R/packages/tests-LENGTH1/MCDM.Rcheck’ * using R Under development (unstable) (2022-04-03 r82074) * using platform: x86_64-pc-linux-gnu (64-bit) * using session charset: UTF-8 * using option ‘--no-stop-on-test-error’ * checking for file ‘MCDM/DESCRIPTION’ ... OK * checking extension type ... Package * this is package ‘MCDM’ version ‘1.2’ * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for executable files ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘MCDM’ can be installed ... OK * checking package directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking R files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking loading without being on the library search path ... OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [7s/13s] OK * checking Rd files ... OK * checking Rd metadata ... OK * checking Rd line widths ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking LazyData ... NOTE 'LazyData' is specified without a 'data' directory * checking examples ... ERROR Running examples in ‘MCDM-Ex.R’ failed The error most likely occurred in: > ### Name: MetaRanking > ### Title: Implementation of MetaRanking function for Multi-Criteria > ### Decision Making Problems. > ### Aliases: MetaRanking > > ### ** Examples > > > d <- matrix(c(1,2,5,3000,3750,4500),nrow = 3,ncol = 2) > w <- c(0.5,0.5) > cb <- c('min','max') > lambda <- 0.5 > v <- 0.5 > AB <- matrix(c(1,5,3000,4500),nrow = 2,ncol=2) > CD <- matrix(c(1,1,4500,4500),nrow = 2,ncol=2) > MetaRanking(d,w,cb,lambda,v,AB,CD) ----------- FAILURE REPORT -------------- --- failure: length > 1 in coercion to logical --- --- srcref --- : --- package (from environment) --- MCDM --- call from context --- VIKOR(decision, weights, cb, v) --- call from argument --- (Q == "NaN") || (Q == "Inf") --- R stacktrace --- where 1: VIKOR(decision, weights, cb, v) where 2: MetaRanking(d, w, cb, lambda, v, AB, CD) --- value of length: 3 type: logical --- [1] FALSE FALSE FALSE --- function from context --- function (decision, weights, cb, v) { if (!is.matrix(decision)) stop("'decision' must be a matrix with the values of the alternatives") if (missing(weights)) stop("a vector containing n weigths, adding up to 1, should be provided") if (sum(weights) != 1) stop("The sum of 'weights' is not equal to 1") if (!is.character(cb)) stop("'cb' must be a character vector with the type of the criteria") if (!all(cb == "max" | cb == "min")) stop("'cb' should contain only 'max' or 'min'") if (length(weights) != ncol(decision)) stop("length of 'weights' does not match the number of the criteria") if (length(cb) != ncol(decision)) stop("length of 'cb' does not match the number of the criteria") if (missing(v)) stop("a value for 'v' in [0,1] should be provided") posI <- as.integer(cb == "max") * apply(decision, 2, max) + as.integer(cb == "min") * apply(decision, 2, min) negI <- as.integer(cb == "min") * apply(decision, 2, max) + as.integer(cb == "max") * apply(decision, 2, min) norm = function(x, w, p, n) { w * ((p - x)/(p - n)) } SAux <- apply(decision, 1, norm, weights, posI, negI) S <- apply(SAux, 2, sum) R <- apply(SAux, 2, max) if (v == 0) Q <- (R - min(R))/(max(R) - min(R)) else if (v == 1) Q <- (S - min(S))/(max(S) - min(S)) else Q <- v * (S - min(S))/(max(S) - min(S)) + (1 - v) * (R - min(R))/(max(R) - min(R)) if ((Q == "NaN") || (Q == "Inf")) { RankingQ <- rep("-", nrow(decision)) } else { RankingQ <- rank(Q, ties.method = "first") } return(data.frame(Alternatives = 1:nrow(decision), S = S, R = R, Q = Q, Ranking = RankingQ)) } --- function search by body --- Function VIKOR in namespace MCDM has this body. ----------- END OF FAILURE REPORT -------------- Fatal error: length > 1 in coercion to logical * checking PDF version of manual ... OK * checking for non-standard things in the check directory ... OK * checking for detritus in the temp directory ... OK * DONE Status: 1 ERROR, 1 NOTE See ‘/data/gannet/ripley/R/packages/tests-LENGTH1/MCDM.Rcheck/00check.log’ for details. Command exited with non-zero status 1 Time 1:06.51, 30.50 + 5.42