is_correlation_matrix: Assert correlation matrix

View source: R/1_assertions.R

is_correlation_matrixR Documentation

Assert correlation matrix

Description

Assert correlation matrix

Usage

is_correlation_matrix(
  x,
  .xname = get_name_in_parent(x),
  severity = getOption("assertive.severity", "stop")
)

assert_correlation_matrix(x, .xname = get_name_in_parent(x))

Arguments

x

correlation matrix

.xname

string

severity

'warning' or 'stop'

Value

TRUE or false

Examples

x <- matrix(c(1,0.7, 0.3, 1), nrow = 2)
rownames(x) <- c('gene1', 'gene2')
colnames(x) <- c('gene1', 'gene2')
is_correlation_matrix(x)
is_correlation_matrix({x[1,1] <- -2; x})

bhagwataditya/importomics documentation built on July 11, 2024, 11:26 a.m.