Checks a matrix for duplicated columns, which reprent samples. Duplicate rows are allowed here, because many genes (rows) can contain all zeros.

hasUniqueCols(x, .xname = getNameInParent(x))

Arguments

x

Object.

.xname

Name of object defined in x. Not intended to be used directly.

Value

TRUE on success; FALSE on failure, with cause set.

Note

Updated 2019-08-10.

SummarizedExperiment

If the object is a SummarizedExperiment, then the primary assay matrix is checked for duplicated columns.

Examples

## TRUE ==== x <- matrix(data = seq_len(20L), ncol = 2L) hasUniqueCols(x)
#> [1] TRUE
## FALSE ==== x <- matrix(data = rep(seq_len(10L), times = 2L), ncol = 2L) hasUniqueCols(x)
#> [1] FALSE #> Cause: 'structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L), .....' has duplicated columns at: 2