get.unique.matrix | R Documentation |
A wrapper for the table.matrix
function that assigns consecutive
row or column names to the output matrix's unique rows or columns.
get.unique.matrix(data, MARGIN = 2, silent = TRUE)
data |
A matrix or data.frame, potentially containing non-unique patterns in its rows or columns. |
MARGIN |
A single integer specifying the array margin to be held fixed.
(To get unique rows, select |
An extension of the base unique.matrix
function,
get.unique.matrix
returns a unique matrix
(by removing duplicate rows or columns), as well as
an index vector that maps each row/column in the original matrix
to the corresponding unique row or column in the deduplicated unique matrix.
A list with the following elements:
index
An index vector containing the indices (row numbers), in a matrix composed only of unique rows, to which each row in the original matrix maps.
unique.data
A new matrix containing only the unique rows of the input matrix.
Caitlin Collins caitiecollins@gmail.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.