Cdiff: Matrix difference (a-b) including checking for equal columns

View source: R/Cdiff.R

CdiffR Documentation

Matrix difference (a-b) including checking for equal columns

Description

Each column is checked by all.equal

Usage

Cdiff(a, b, tolerance = sqrt(.Machine$double.eps))

Arguments

a

numerical matrix

b

numerical matrix

tolerance

parameter to all.equal

Value

(a-b) where equal columns are set to zero

Examples

a <- matrix(rnorm(6), 3, 2)
b <- matrix(rnorm(6), 3, 2)
a - b
Cdiff(a, b)
b[, 1] <- a[, 1] + (.Machine$double.eps)^(2/3) * b[, 1]
a - b
Cdiff(a, b)
a[, 2] <- b[, 2]
a - b
Cdiff(a, b)

RegSDC documentation built on Aug. 19, 2022, 9:08 a.m.

Related to Cdiff in RegSDC...