Title: | Compute Analytic Hierarchy Process |
---|---|
Description: | Compute a tree level hierarchy, judgment matrix, consistency index and ratio, priority vectors, hierarchic synthesis and rank. Based on the book entitled "Models, Methods, Concepts and Applications of the Analytic Hierarchy Process" by Saaty and Vargas (2012, ISBN 978-1-4614-3597-6). |
Authors: | Luciane Ferreira Alcoforado [aut, cre], Lyncoln Sousa [aut], Orlando Celso Longo [aut], Alessandra Simão [ctb], Steven Dutt Ross [ctb], Leonardo Filgueira [ctb] |
Maintainer: | Luciane Ferreira Alcoforado <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-10-11 04:45:49 UTC |
Source: | https://github.com/cran/AHPWR |
Calculates AHP in a list of paired arrays or in a properly formatted excel worksheet stipend.
ahp(base, mapeamento, nomes_alternativas)
ahp(base, mapeamento, nomes_alternativas)
base |
List of paired arrays or excel path containing the properly formatted paired arrays. |
mapeamento |
Vector containing the number of subscriptions of each criteria, from left to right. mapeamento = rep(0,n) n = number of criteria and no subcriteria; mapeamento = c(1,2) for one subcriteria in criteria 1 anda two subcriteria in criteria 2. If in doubt, see the tutorial vignette. |
nomes_alternativas |
Vector containing the names of the alternatives in your hierarchy, if not filled returns a vector of LETTERS. |
Table containing the relationships of criteria, subscriptions (If any) and Alternatives Using the AHP system.
Lyncoln Oliveira and Luciane Ferreira Alcoforado
x=paste0(letters[3],1:5) y=c(5,2,7,3,2) m1=matrix_ahp(x,y) x=paste0(letters[1],1:3) y=c(4.4,5.2,3) m2=matrix_ahp(x,y) y=c(2,4,3) m3=matrix_ahp(x,y) y=c(4.9,5,3.3) m4=matrix_ahp(x,y) y=c(4.4,4.2,4.3) m5=matrix_ahp(x,y) y=c(5.4,5.2,5.7) m6=matrix_ahp(x,y) base=list(m1, m2, m3, m4, m5, m6) mapeamento = rep(0,5) nomes_alternativas = paste0(letters[1],1:3) ahp(base,mapeamento, nomes_alternativas) #with subcriteria and 3 criteria and 2 alternatives mapeamento = c(2,0,0) #2 subcriteria in criteria 1 and 0 subcriteria to others x=paste0(letters[3],1:3) #3 criteria y=c(5,2,7) m1=matrix_ahp(x,y) #compare criteria x=paste0(letters[4],1:2) y=c(4,6) m2=matrix_ahp(x,y) # 2 compare 2 subcriteria of criteria 1 x=paste0(letters[1],1:2) y=c(2,4) m3=matrix_ahp(x,y) #alternatives for subcriteria 1 y=c(4.9,5) m4=matrix_ahp(x,y) #alternatives for subcriteria 2 y=c(4.4,4.2) m5=matrix_ahp(x,y) #alternatives for criteria 2 y=c(5.4,5.2) m6=matrix_ahp(x,y) ##alternatives for criteria 3 base=list(m1, m2, m3, m4, m5, m6) nomes_alternativas = paste0(letters[1],1:2) ahp(base,mapeamento, nomes_alternativas) #Other mapeamento: criteria 2 with 2 subcriteria mapeamento = c(0,2,0) nomes_alternativas = paste0(letters[1],1:2) ahp(base,mapeamento, nomes_alternativas)
x=paste0(letters[3],1:5) y=c(5,2,7,3,2) m1=matrix_ahp(x,y) x=paste0(letters[1],1:3) y=c(4.4,5.2,3) m2=matrix_ahp(x,y) y=c(2,4,3) m3=matrix_ahp(x,y) y=c(4.9,5,3.3) m4=matrix_ahp(x,y) y=c(4.4,4.2,4.3) m5=matrix_ahp(x,y) y=c(5.4,5.2,5.7) m6=matrix_ahp(x,y) base=list(m1, m2, m3, m4, m5, m6) mapeamento = rep(0,5) nomes_alternativas = paste0(letters[1],1:3) ahp(base,mapeamento, nomes_alternativas) #with subcriteria and 3 criteria and 2 alternatives mapeamento = c(2,0,0) #2 subcriteria in criteria 1 and 0 subcriteria to others x=paste0(letters[3],1:3) #3 criteria y=c(5,2,7) m1=matrix_ahp(x,y) #compare criteria x=paste0(letters[4],1:2) y=c(4,6) m2=matrix_ahp(x,y) # 2 compare 2 subcriteria of criteria 1 x=paste0(letters[1],1:2) y=c(2,4) m3=matrix_ahp(x,y) #alternatives for subcriteria 1 y=c(4.9,5) m4=matrix_ahp(x,y) #alternatives for subcriteria 2 y=c(4.4,4.2) m5=matrix_ahp(x,y) #alternatives for criteria 2 y=c(5.4,5.2) m6=matrix_ahp(x,y) ##alternatives for criteria 3 base=list(m1, m2, m3, m4, m5, m6) nomes_alternativas = paste0(letters[1],1:2) ahp(base,mapeamento, nomes_alternativas) #Other mapeamento: criteria 2 with 2 subcriteria mapeamento = c(0,2,0) nomes_alternativas = paste0(letters[1],1:2) ahp(base,mapeamento, nomes_alternativas)
Calculates AHP in a list of paired arrays or in a properly formatted excel worksheet stipend.
ahp_geral(objeto, mapeamento = "PADRAO", nomes_alternativas = "PADRAO")
ahp_geral(objeto, mapeamento = "PADRAO", nomes_alternativas = "PADRAO")
objeto |
List of paired arrays or excel path containing the properly formatted paired arrays. |
mapeamento |
Vector containing the number of subscriptions of each criteria, from left to right. If not filled the pattern and fill with 0. If in doubt, see the tutorial vignette. |
nomes_alternativas |
Vector containing the names of the alternatives in your hierarchy, if not filled returns a vector of LETTERS\[1\:qtdAlternatives\] |
Table containing the relationships of criteria, subscriptions (If any) and Alternatives Using the AHP system.
Lyncoln Oliveira
m1=matrix(c(1, 1/5, 3, 1/5, 1/3,5, 1, 5, 3, 3, 1/3, 1/5, 1, 1/3, 1/3,5, 1/3, 3, 1, 1,3, 1/3, 3, 1, 1),ncol=5,byrow=TRUE) m2=matrix(c(1, 1/3, 1/6, 3, 1, 1/2,6, 2, 1),nrow=3, byrow=TRUE) m3=matrix(c(1, 1/2, 1/2,2, 1, 2, 2, 1/2, 1),nrow=3, byrow=TRUE) m4=matrix(c(1, 1, 2,1, 1, 1, 1/2, 1, 1),nrow=3, byrow=TRUE) m5=matrix(c(1, 2, 3,1/2, 1, 2, 1/3, 1/2, 1),nrow=3, byrow=TRUE) m6=matrix(c(1, 5, 3,1/5, 1, 1/3, 1/3, 3, 1),nrow=3, byrow=TRUE) base=list(m1,m2,m3,m4,m5,m6) mapeamento=rep(0,5) nomes_alternativas="PADRAO" ahp_geral(base,mapeamento, nomes_alternativas)
m1=matrix(c(1, 1/5, 3, 1/5, 1/3,5, 1, 5, 3, 3, 1/3, 1/5, 1, 1/3, 1/3,5, 1/3, 3, 1, 1,3, 1/3, 3, 1, 1),ncol=5,byrow=TRUE) m2=matrix(c(1, 1/3, 1/6, 3, 1, 1/2,6, 2, 1),nrow=3, byrow=TRUE) m3=matrix(c(1, 1/2, 1/2,2, 1, 2, 2, 1/2, 1),nrow=3, byrow=TRUE) m4=matrix(c(1, 1, 2,1, 1, 1, 1/2, 1, 1),nrow=3, byrow=TRUE) m5=matrix(c(1, 2, 3,1/2, 1, 2, 1/3, 1/2, 1),nrow=3, byrow=TRUE) m6=matrix(c(1, 5, 3,1/5, 1, 1/3, 1/3, 3, 1),nrow=3, byrow=TRUE) base=list(m1,m2,m3,m4,m5,m6) mapeamento=rep(0,5) nomes_alternativas="PADRAO" ahp_geral(base,mapeamento, nomes_alternativas)
Calculates AHP in a list of paired arrays or in a properly formatted excel worksheet stipend.
ahp_s(base, map)
ahp_s(base, map)
base |
List of paired arrays or excel path containing the properly formatted paired arrays. |
map |
Vector containing the number of subscriptions of each criteria, from left to right. map = rep(0,n) n = number of criteria and no subcriteria; mapeamento = c(1,2) for one subcriteria in criteria 1 and two subcriteria in criteria 2. If in doubt, see the tutorial vignette. |
Table containing the relationships of criteria, subscriptions (If any) and Alternatives Using the AHP system.
Luciane Ferreira Alcoforado
x=paste0(letters[3],1:5) y=c(5,2,7,3,2) m1=matrix_ahp(x,y) x=paste0(letters[1],1:3) y=c(4.4,5.2,3) m2=matrix_ahp(x,y) y=c(2,4,3) m3=matrix_ahp(x,y) y=c(4.9,5,3.3) m4=matrix_ahp(x,y) y=c(4.4,4.2,4.3) m5=matrix_ahp(x,y) y=c(5.4,5.2,5.7) m6=matrix_ahp(x,y) base=list(m1, m2, m3, m4, m5, m6) map = rep(0,5) ahp_s(base,map) #with two subcriteria in criteria 1 and 2 alternatives map = c(2,0,0) x=paste0(letters[3],1:3) #3 criteria y=c(5,2,7) m1=matrix_ahp(x,y) # matrix compare three criteria x=paste0("SC1",1:2) y=c(4,6) m2=matrix_ahp(x,y) # 2 matrix compare two subcriteria of criteria 1 x=paste0(letters[1],1:2) y=c(2,4) m3=matrix_ahp(x,y) #alternatives for subcriteria 1 y=c(4.9,5) m4=matrix_ahp(x,y) #alternatives for subcriteria 2 y=c(4.4,4.2) m5=matrix_ahp(x,y) #alternatives for criteria 2 y=c(5.4,5.2) m6=matrix_ahp(x,y) ##alternatives for criteria 3 base=list(m1, m2, m3, m4, m5, m6) ahp_s(base,map) #Other mapeamento: criteria 2 with 2 subcriteria and 3 alternatives map = c(2,2) x=paste0(letters[3],1:2) #2 criteria y=c(5,7) m1=matrix_ahp(x,y) # matrix compare two criteria x=paste0("SC1",1:2) y=c(4,6) m2=matrix_ahp(x,y) # matrix compare two subcriteria of criteria 1 x=paste0(letters[1],1:3) y=c(2,4,5) m3=matrix_ahp(x,y) #alternatives for subcriteria 1 - criteria 1 y=c(4.9,5, 2) m4=matrix_ahp(x,y) #alternatives for subcriteria 2 - criteria 1 y=c(4.4,8, 6) x=paste0("SC2",1:2) m5=matrix_ahp(x,y) #matrix compare two subcriteria of criteria 2 y=c(5.4,5.2, 1) x=paste0(letters[1],1:3) m6=matrix_ahp(x,y) #alternatives for subcriteria 1 - criteria 2 y=c(9,5.2, 3) m7=matrix_ahp(x,y) #alternatives for subcriteria 2 - criteria 2 base=list(m1, m2, m3, m4, m5, m6, m7) ahp_s(base,map)
x=paste0(letters[3],1:5) y=c(5,2,7,3,2) m1=matrix_ahp(x,y) x=paste0(letters[1],1:3) y=c(4.4,5.2,3) m2=matrix_ahp(x,y) y=c(2,4,3) m3=matrix_ahp(x,y) y=c(4.9,5,3.3) m4=matrix_ahp(x,y) y=c(4.4,4.2,4.3) m5=matrix_ahp(x,y) y=c(5.4,5.2,5.7) m6=matrix_ahp(x,y) base=list(m1, m2, m3, m4, m5, m6) map = rep(0,5) ahp_s(base,map) #with two subcriteria in criteria 1 and 2 alternatives map = c(2,0,0) x=paste0(letters[3],1:3) #3 criteria y=c(5,2,7) m1=matrix_ahp(x,y) # matrix compare three criteria x=paste0("SC1",1:2) y=c(4,6) m2=matrix_ahp(x,y) # 2 matrix compare two subcriteria of criteria 1 x=paste0(letters[1],1:2) y=c(2,4) m3=matrix_ahp(x,y) #alternatives for subcriteria 1 y=c(4.9,5) m4=matrix_ahp(x,y) #alternatives for subcriteria 2 y=c(4.4,4.2) m5=matrix_ahp(x,y) #alternatives for criteria 2 y=c(5.4,5.2) m6=matrix_ahp(x,y) ##alternatives for criteria 3 base=list(m1, m2, m3, m4, m5, m6) ahp_s(base,map) #Other mapeamento: criteria 2 with 2 subcriteria and 3 alternatives map = c(2,2) x=paste0(letters[3],1:2) #2 criteria y=c(5,7) m1=matrix_ahp(x,y) # matrix compare two criteria x=paste0("SC1",1:2) y=c(4,6) m2=matrix_ahp(x,y) # matrix compare two subcriteria of criteria 1 x=paste0(letters[1],1:3) y=c(2,4,5) m3=matrix_ahp(x,y) #alternatives for subcriteria 1 - criteria 1 y=c(4.9,5, 2) m4=matrix_ahp(x,y) #alternatives for subcriteria 2 - criteria 1 y=c(4.4,8, 6) x=paste0("SC2",1:2) m5=matrix_ahp(x,y) #matrix compare two subcriteria of criteria 2 y=c(5.4,5.2, 1) x=paste0(letters[1],1:3) m6=matrix_ahp(x,y) #alternatives for subcriteria 1 - criteria 2 y=c(9,5.2, 3) m7=matrix_ahp(x,y) #alternatives for subcriteria 2 - criteria 2 base=list(m1, m2, m3, m4, m5, m6, m7) ahp_s(base,map)
Calculates the eigen vector of matrix
autoVetor(matriz)
autoVetor(matriz)
matriz |
a paired matrix |
Returns a normalized eigenvector
Lyncoln Oliveira
m=diag(16)+2-2*diag(16) m autoVetor(m)
m=diag(16)+2-2*diag(16) m autoVetor(m)
Calculates the priority vector of a paired array based on a list
calcula_prioridades(lista)
calcula_prioridades(lista)
lista |
a paired matrix list |
Returns a list containing priority vectors for each matrix in the read list
Lyncoln Oliveira
Function to calculate the saaty's consistency index
CI(m)
CI(m)
m |
is a matrice of pairwise comparison |
Returns saaty's consistency index
Luciane Ferreira Alcoforado
x=c("c1", "c2", "c3", "c4") y=c(3, 9, 2, 8) m=matrix_ahp(x,y) CI(m) x=c("a1", "a2", "a3", "a4", "a5") y=c(1, 9, 1.5, 8, 6) m=matrix_ahp(x,y) CI(m) m=diag(16)+2-2*diag(16) m CI(m) CR(m)
x=c("c1", "c2", "c3", "c4") y=c(3, 9, 2, 8) m=matrix_ahp(x,y) CI(m) x=c("a1", "a2", "a3", "a4", "a5") y=c(1, 9, 1.5, 8, 6) m=matrix_ahp(x,y) CI(m) m=diag(16)+2-2*diag(16) m CI(m) CR(m)
Function to calculate the saaty's consistency ratio
CR(m)
CR(m)
m |
is a matrice of pairwise comparison |
Returns saaty's consistency ratio in [0,1]
Luciane Ferreira Alcoforado
x=c("c1", "c2", "c3", "c4") y=c(3, 9, 2, 8) m=matrix_ahp(x,y) CR(m) x=c("a1", "a2", "a3", "a4", "a5") y=c(1, 9, 1.5, 8, 6) m=matrix_ahp(x,y) CR(m) m=diag(16)+2-2*diag(16) m CI(m) CR(m)
x=c("c1", "c2", "c3", "c4") y=c(3, 9, 2, 8) m=matrix_ahp(x,y) CR(m) x=c("a1", "a2", "a3", "a4", "a5") y=c(1, 9, 1.5, 8, 6) m=matrix_ahp(x,y) CR(m) m=diag(16)+2-2*diag(16) m CI(m) CR(m)
Function to build the Diagram of hierarchies
flow_chart(names, c, a)
flow_chart(names, c, a)
names |
is a vector with names for goal, criteria and choices in this exact sequence |
c |
is a integer number of criteria, c>=2 |
a |
is a integer number of choices, a>=2 |
Returns Diagram of hierarchies
Luciane Ferreira Alcoforado
p=flow_chart(names=NULL, a=2, c=2) p p=flow_chart(names=NULL, a=2, c=3) p+ggplot2::theme_void() flow_chart(names=c("G", "cost", "time", "hour", "home", "beach"),c=3, a=2)
p=flow_chart(names=NULL, a=2, c=2) p p=flow_chart(names=NULL, a=2, c=3) p+ggplot2::theme_void() flow_chart(names=c("G", "cost", "time", "hour", "home", "beach"),c=3, a=2)
Format an AHP table created by the general ahp() function
formata_tabela(tabela, cores = "PADRAO")
formata_tabela(tabela, cores = "PADRAO")
tabela |
AHP table created by the general ahp() function |
cores |
Color pattern to format the table. If "PADRAO" returns the color pattern (green, blue, green or blue); if "GRAY" returns the default gray color; if "WHITE" returns the table without colors |
Returns a table formatted with background colors responsive to element priority amounts
Lyncoln Oliveira
Format an AHP table created by the general ahp() function
formata_tabela2(tabela, cores = "PADRAO")
formata_tabela2(tabela, cores = "PADRAO")
tabela |
AHP table created by the general ahp() function |
cores |
Color pattern to format the table. If "PADRAO" returns the color pattern (green, blue, green or blue); if "GRAY" returns the default gray color; if "WHITE" returns the table without colors |
Retorna uma tabela formatada com cores defundo responsivas as quantidades de prioridade dos elementos
Lyncoln Oliveira
Function to Read an excel file containing the paired matrices and turn all your spreadsheets into a list of matrices in Re
ler(caminho)
ler(caminho)
caminho |
Address to an excel file that contains the worksheets |
Returns a list containing the paired arrays from the excel file
Lyncoln Oliveira
caminho <- system.file("tests", "test_import.xlsx", package = "xlsx") lista = ler(caminho)
caminho <- system.file("tests", "test_import.xlsx", package = "xlsx") lista = ler(caminho)
Function to build the judment matrix
matrix_ahp(x, y)
matrix_ahp(x, y)
x |
is a vector of names criteria or choices |
y |
is a vector of weigth scale Saaty, in [1,9] |
Returns a judment matrice.
Luciane Ferreira Alcoforado
x=c("c1", "c2", "c3", "c4") y=c(3, 9, 2, 8) matrix_ahp(x,y) x=c("a1", "a2", "a3", "a4", "a5") y=c(1, 9, 1.5, 8, 6) matrix_ahp(x,y)
x=c("c1", "c2", "c3", "c4") y=c(3, 9, 2, 8) matrix_ahp(x,y) x=c("a1", "a2", "a3", "a4", "a5") y=c(1, 9, 1.5, 8, 6) matrix_ahp(x,y)
Function that Create paired matrix and can test saaty consistency rate
matriz_julgamento(n_comp, CR = TRUE, n_matrix = 1)
matriz_julgamento(n_comp, CR = TRUE, n_matrix = 1)
n_comp |
Number of elements to be evaluated |
CR |
If TRUE also returns the consistency rate of saaty, if FALSE returns only matrix |
n_matrix |
Number of matrix to be created |
Returns a list with 2 positions. First position contains the paired matrices and the second position their consistency rates
Lyncoln Oliveira
Function that generates vectors of weights for criteria and alternatives
normaliza(lista)
normaliza(lista)
lista |
is a list with judment matrices |
Returns auxiliary list
Lyncoln Oliveira
lista = list(M1=diag(3), M2=diag(3)+4-4*diag(3)) normaliza(lista)
lista = list(M1=diag(3), M2=diag(3)+4-4*diag(3)) normaliza(lista)
Calculates ranking of alternatives for a list of judment matrix
ranque(tabela)
ranque(tabela)
tabela |
table building by ahp_s or ahp_geral |
Table containing the ranking of alternatives
Lyncoln Oliveira
x=paste0(letters[3],1:5) y=c(5,2,7,3,2) m1=matrix_ahp(x,y) x=paste0(letters[1],1:3) y=c(4.4,5.2,3) m2=matrix_ahp(x,y) y=c(2,4,3) m3=matrix_ahp(x,y) y=c(4.9,5,3.3) m4=matrix_ahp(x,y) y=c(4.4,4.2,4.3) m5=matrix_ahp(x,y) y=c(5.4,5.2,5.7) m6=matrix_ahp(x,y) base=list(m1, m2, m3, m4, m5, m6) mapeamento = rep(0,5) nomes_alternativas = paste0(letters[1],1:3) tabela = ahp(base,mapeamento, nomes_alternativas) ranque(tabela) #with subcriteria and 3 criteria and 2 alternatives mapeamento = c(2,0,0) #2 subcriteria in criteria 1 and 0 subcriteria to others x=paste0(letters[3],1:3) #3 criteria y=c(5,2,7) m1=matrix_ahp(x,y) #compare criteria x=paste0(letters[4],1:2) y=c(4,6) m2=matrix_ahp(x,y) # 2 compare 2 subcriteria of criteria 1 x=paste0(letters[1],1:2) y=c(2,4) m3=matrix_ahp(x,y) #alternatives for subcriteria 1 y=c(4.9,5) m4=matrix_ahp(x,y) #alternatives for subcriteria 2 y=c(4.4,4.2) m5=matrix_ahp(x,y) #alternatives for criteria 2 y=c(5.4,5.2) m6=matrix_ahp(x,y) ##alternatives for criteria 3 base=list(m1, m2, m3, m4, m5, m6) nomes_alternativas = paste0(letters[1],1:2) tabela = ahp(base,mapeamento, nomes_alternativas) ranque(tabela)
x=paste0(letters[3],1:5) y=c(5,2,7,3,2) m1=matrix_ahp(x,y) x=paste0(letters[1],1:3) y=c(4.4,5.2,3) m2=matrix_ahp(x,y) y=c(2,4,3) m3=matrix_ahp(x,y) y=c(4.9,5,3.3) m4=matrix_ahp(x,y) y=c(4.4,4.2,4.3) m5=matrix_ahp(x,y) y=c(5.4,5.2,5.7) m6=matrix_ahp(x,y) base=list(m1, m2, m3, m4, m5, m6) mapeamento = rep(0,5) nomes_alternativas = paste0(letters[1],1:3) tabela = ahp(base,mapeamento, nomes_alternativas) ranque(tabela) #with subcriteria and 3 criteria and 2 alternatives mapeamento = c(2,0,0) #2 subcriteria in criteria 1 and 0 subcriteria to others x=paste0(letters[3],1:3) #3 criteria y=c(5,2,7) m1=matrix_ahp(x,y) #compare criteria x=paste0(letters[4],1:2) y=c(4,6) m2=matrix_ahp(x,y) # 2 compare 2 subcriteria of criteria 1 x=paste0(letters[1],1:2) y=c(2,4) m3=matrix_ahp(x,y) #alternatives for subcriteria 1 y=c(4.9,5) m4=matrix_ahp(x,y) #alternatives for subcriteria 2 y=c(4.4,4.2) m5=matrix_ahp(x,y) #alternatives for criteria 2 y=c(5.4,5.2) m6=matrix_ahp(x,y) ##alternatives for criteria 3 base=list(m1, m2, m3, m4, m5, m6) nomes_alternativas = paste0(letters[1],1:2) tabela = ahp(base,mapeamento, nomes_alternativas) ranque(tabela)
Function to organizes a table with comparison matrix data
tabela_holistica(pesos)
tabela_holistica(pesos)
pesos |
vector with holistic weights for comparison or comparison matrix data |
Returns a table with assigned holistic weights, comparison matrix, priority vector and consistency ratio
Luciane Ferreira Alcoforado & Orlando Longo
pesos = c(3, 7, 9, 2) names(pesos) = paste0("C",1:4) tabela_holistica(pesos) m = matrix_ahp(y=c(3,4,3,2.5), x=paste0("A",1:4)) tabela_holistica(pesos=m)
pesos = c(3, 7, 9, 2) names(pesos) = paste0("C",1:4) tabela_holistica(pesos) m = matrix_ahp(y=c(3,4,3,2.5), x=paste0("A",1:4)) tabela_holistica(pesos=m)
Function to Transforms table with numbers into percentage with 2 decimal places
transforma_tabela(tabela)
transforma_tabela(tabela)
tabela |
table to transforms |
Returns a transform table with percentage
Lyncoln Oliveira
tabela=data.frame(x=c(0.5, 0.25), y=c(0.55, 0.93)) transforma_tabela(tabela)
tabela=data.frame(x=c(0.5, 0.25), y=c(0.55, 0.93)) transforma_tabela(tabela)
Function to buil file with judment matrices
xlsx_ahp(m, file, sheet, append)
xlsx_ahp(m, file, sheet, append)
m |
is a matrice of pairwise comparison |
file |
is the path to the output file. |
sheet |
is a character string with the sheet name. |
append |
is a logical value indicating if m should be appended to an existing file. If TRUE the file is read from disk. |
Returns a xlsx document
#m=diag(10) #file1 = xlsx_ahp(m, file = "Example_1.xlsx", sheet = "M1", append = FALSE) #file2=xlsx_ahp(m, file = "Example_1.xlsx", sheet = "M2", append = TRUE)
#see file Example_1.XLSX in working directory
Luciane Ferreira Alcoforado