enumerate_unique_rows: Enumerate unique and duplicate rows in a matrix like object.

Description Usage Arguments Value

View source: R/compute.R

Description

Identify which rows of a matrix are unique and which are duplicates, including identifying which row they are a duplicate of. Unique rows are numbered sequentially.

Usage

1

Arguments

mat

A matrix like object

Value

A list containing the a vector of unique row indices indeces, corresponding to each rows coresponding unique row in a deduplicated matrix, and a logical vector showing whether each row is duplicate (duplicated). These two vectors are sufficient to extract a deduplcated matrix (deduped <- mat[!duplicate,]) and reconstruct the original (mat == deduped[indeces,]).


allydunham/tblhelpr documentation built on Nov. 20, 2019, 7:35 a.m.