Learn R Programming

Prize (version 1.2.0)

ahmatrix: ahmatrix

Description

Converting a triangular matrix into a square pairwise comparison matrix (PCM) where the diagonal values are equal to 1 and a[i,j] = 1/a[j,i].

Usage

ahmatrix(x)

Arguments

x
a numeric triangular matrix, where empty elements are specified with NA.

Value

An S4 object including a PCM.

Examples

Run this code
mat <- matrix(nrow = 3, ncol = 3, data = NA)
mat[1,2] <- 5
mat[1,3] <- 2
mat[2,3] <- 7

res <- ahmatrix(mat)

Run the code above in your browser using DataLab