uniqueBidirection: uniqueBidirection

View source: R/unique.r

uniqueBidirectionR Documentation

uniqueBidirection

Description

Find unique rows of a data.frame regardless of the order they appear

Usage

uniqueBidirection(x)

Arguments

x

a data.frame

Details

Sorts individual rows to get uniques regardless of order of appearance.

Value

A data.frame that is unique regardless of direction

Author(s)

Jared P. Lander

Examples


ex <- data.frame(One=c('a', 'c', 'a', 'd', 'd', 'c', 'b'), 
Two=c('b', 'd', 'b', 'e', 'c', 'd', 'a'),
stringsAsFactors=FALSE)

# make a bigger version
exBig <- ex
for(i in 1:1000)
{
    exBig <- rbind(exBig, ex)
}

dim(exBig)

uniqueBidirection(ex)
uniqueBidirection(exBig)

ex3 <- dplyr::bind_cols(ex, dplyr::data_frame(Three=rep('a', nrow(ex))))
uniqueBidirection(ex3)


useful documentation built on Oct. 24, 2023, 9:07 a.m.