uniqueBidirection | R Documentation |
Find unique rows of a data.frame regardless of the order they appear
uniqueBidirection(x)
x |
a data.frame |
Sorts individual rows to get uniques regardless of order of appearance.
A data.frame that is unique regardless of direction
Jared P. Lander
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, tibble::tibble(Three=rep('a', nrow(ex))))
uniqueBidirection(ex3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.