weightedSum: Weighted sum of evaluations of alternatives.

Description Usage Arguments Value Examples

View source: R/weightedSum.R

Description

Computes the weighted sum of the evaluations of alternatives, stored in a performance table, with respect to a vector of criteria weights.

Usage

1
2
weightedSum(performanceTable, criteriaWeights, 
      alternativesIDs = NULL, criteriaIDs = NULL)

Arguments

performanceTable

Matrix or data frame containing the performance table. Each row corresponds to an alternative, and each column to a criterion. Rows (resp. columns) must be named according to the IDs of the alternatives (resp. criteria).

criteriaWeights

Vector containing the weights of the criteria. The elements are named according to the IDs of the criteria.

alternativesIDs

Vector containing IDs of alternatives, according to which the performance table should be filtered.

criteriaIDs

Vector containing IDs of criteria, according to which the performance table should be filtered.

Value

The function returns a vector containing the weighted sum of the alternatives with respect to the criteria weights.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
performanceTable <- matrix(runif(3*4), ncol=3)

row.names(performanceTable) <- c("x1","x2","x3","x4")

colnames(performanceTable) <- c("g1","g2","g3")

weights <- c(1,2,3)

names(weights) <- c("g1","g2","g3")

overall1 <- weightedSum(performanceTable, weights)

overall2 <- weightedSum(performanceTable, weights, 
      alternativesIDs <- c("x2","x3"), criteriaIDs <- c("g2","g3"))

MCDA documentation built on March 18, 2018, 1:59 p.m.