identicalMatrix: Test whether two matrices are identical by values and by dim...

Description Usage Arguments Value Examples

View source: R/identicalMatrix.R

Description

Test whether two matrices are identical by values and by dim names

Usage

1
identicalMatrix(x, y, epsilon = 1e-12)

Arguments

x

a matrix

y

another matrix

epsilon

accuracy threshold: absolute differences below this threshold is ignored

Value

Logical

Examples

1
2
3
4
5
set.seed(1887); x <- matrix(rnorm(1000), nrow=10, dimnames=list(LETTERS[1:10],NULL))
set.seed(1887); y <- matrix(rnorm(1000), nrow=10, dimnames=list(LETTERS[1:10],NULL))
set.seed(1887); z <- matrix(rnorm(1000), nrow=10, dimnames=list(letters[1:10],NULL))
stopifnot(identicalMatrix(x,y))
stopifnot(!identicalMatrix(x,z))

ribiosUtils documentation built on March 13, 2020, 2:54 a.m.