removeDuplicateFeatures: Remove Duplicate Features from a Binary Matrix Object

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/02-binaryMatrix.R

Description

The removeDuplicateFeatures function removes duplicate columns from a binaryMatrix object in the Mercator package.

Usage

1

Arguments

object

An object of class binaryMatrix.

Details

In some analyses, it may be desirable to remove duplicate features to collapse a group of identical, related events to a single feature, to prevent overweighting when clustering.

Removal of duplicate features is not required for performance of the binaryMatrix or Mercator objects and associated functions.

The history slot of the binaryMatrix object documents removal of duplicate features.

Future versions of this package may include functionality to store the identities of duplicate features removed.

Value

Returns an object of class binaryMatrix with duplicate columns removed.

Note

Transposing the binaryMatrix can allow the removeDuplicateFeatures function to be applied to both features and observations, if desired.

Features containing exclusively 0s or 1s may interfere with performance of removeDuplicateFeatures.

Author(s)

Kevin R. Coombes <krc@silicovore.com>, Caitlin E. Coombes

Examples

1
2
3
4
5
6
7
8
my.matrix <- matrix(rbinom(50*100, 1, 0.15), ncol=50)
my.matrix <- cbind(my.matrix, my.matrix[, 1:5]) # add duplicates
dimnames(my.matrix) <- list(paste("R", 1:100, sep=''),
                            paste("C", 1:55, sep=''))
my.binmat <- BinaryMatrix(my.matrix)
dim(my.binmat)
my.binmat <- removeDuplicateFeatures(my.binmat)
dim(my.binmat)

Mercator documentation built on Oct. 16, 2020, 3:01 a.m.