| BinaryMatrix-class | R Documentation |
"BinaryMatrix"The BinaryMatrix object class underlies the threshLGF and Mercator
methods and visualizations of the Mercator package. The BinaryMatrix function
returns a new object of BinaryMatrix class.
BinaryMatrix(binmat, columnInfo, rowInfo)
binmat |
A binary |
columnInfo |
A |
rowInfo |
A |
The BinaryMatrix function returns a new object of binaryMatrix class.
Objects should be defined using the BinaryMatrix constructor. In
the simplest case, you simply pass in the binary data matrix that you
want to visualize, and the BinaryMatrix is constructed using the matrix's
existing column and row names.
binmat:Object of class matrix; the binary data
used for visualization.
columnInfo:Object of class data.frame; names and
definitions of columns.
rowInfo:Object of class data.frame; names and
definitions of rows.
info:Object of class list; identifies $notUsed
and $redundant features.
history:Object of class "character"; returns a
history of manipulations by Mercator functions to the BinaryMatrix
object, including "Newly created," "Subsetted," "Transposed," "Duplicate
features removed," and "Threshed."
[]:Subsetting by [] returns a subsetted binary matrix,
including subsetted row and column names. Calling @history will
return the history "Subsetted."
dim:returns the dimensions of the @binmat component
of the binaryMatrix object.
print:Shows the first ten rows and columns
of the @binmat component.
show:Shows the first ten rows and columns
of the @binmat component.
summary:For a given BinaryMatrix, returns object class,
dimensions of the @binmat component, and @history.
t:Transposes the @binmat and its associated rowInfo
and columnInfo. Calling @history will return the history
"Subsetted."
Attempting to construct or manipulate a BinaryMatrix containing NAs, missing values,
or columns containing exclusively 0 values may introduce error.
Kevin R. Coombes <krc@silicovore.com>, Caitlin E. Coombes
The removeDuplicateFeatures function can be used to remove
duplicate columns from the binaryMatrix class before threshing or visualization.
The threshLGF can be used to identify and remove uninformative features
before visualization or further analysis.
my.matrix <- matrix(rbinom(50*100, 1, 0.15), ncol=50)
my.rows <- as.data.frame(paste("R", 1:100, sep=""))
my.cols <- as.data.frame(paste("C", 1:50, sep=""))
my.binmat <- BinaryMatrix(my.matrix, my.cols, my.rows)
summary(my.binmat)
my.binmat <- my.binmat[1:50, 1:30]
my.binmat <- t(my.binmat)
dim(my.binmat)
my.binmat@history
my.binmat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.