CreateCompareMatrix: Create Comparison Matrix

Description Usage Arguments Value Examples

View source: R/CreateCompareMatrix.R

Description

Given two numeric matrices with equal dimensions, create a matrix of max values of corresponding cells and apply row and column names. NA's are only returned if both matrices have NA in the same cell.

Usage

1
CreateCompareMatrix(studentlist, Exams, matrix1, matrix2)

Arguments

studentlist

A vector of row names

Exams

A vector of column names

matrix1

A numeric matrix

matrix2

A numeric matrix with the same dimensions as matrix1

Value

A numeric matrix with the same dimensions as the input matrices

Examples

1
2
3
4
5
6
7
8
s1 = LETTERS[1:5]
E1 = c("Math", "Science", "History")
m1 = matrix(sample(100, 15, F), 5)
m2 = matrix(c(NA, 7*(1:14)), 5)
m3 = matrix(c(NA, NA, 100 - 7*(1:13)), 5)
CreateCompareMatrix(s1, E1, m1, m2)
CreateCompareMatrix(s1, E1, m1, m3)
CreateCompareMatrix(s1, E1, m2, m3)

debarros/dbTools documentation built on Sept. 18, 2020, 10:51 a.m.