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

Not intended to be used directly.

Value

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

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 of failure: #> structure(c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L), .Dim = c(10L, 2L)) has duplicated columns at: 2