DoPartUnique: Speed-up Doing Unique for Data.frame

View source: R/utils.R

DoPartUniqueR Documentation

Speed-up Doing Unique for Data.frame

Description

This function uses the properties of data.frame and rownames, and makes partial unique process fast and effective.

Usage

DoPartUnique(xxpairs, cols.select = c(1:2))

Arguments

xxpairs

Data.frame. Any data.frame object.

cols.select

Integer. Specify some columns in integer vector, e.g. c(1:2). Its length must be >= 2, or the function will not work properly.

Details

When encountering multi-columns tables, e.g. 6 columns or more, unique() will be really slow if it is applied on the whole table. However, in most circumstances, there is no need to apply unique() on all columns, i.e. only do unique on some columns, which is exactly the thing this function does.


ZJUDBlab/InterCellDB documentation built on March 19, 2023, 4:56 p.m.