uniqueBidirection {useful}R 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)


[Package useful version 1.2.6.1 Index]