Title: | A Faster Unique Function |
---|---|
Description: | Similar to base's unique function, only optimized for working with data frames, especially those that contain date-time columns. |
Authors: | Michael Wayne Kearney [aut, cre]
|
Maintainer: | Michael Wayne Kearney <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.0.1 |
Built: | 2025-01-26 04:24:59 UTC |
Source: | https://github.com/mkearney/funique |
Similar to unique
, only optimized for working with
date-time columns.
funique(x)
funique(x)
x |
Input data. If x is not a data frame or date-time object, then it is
simply passed to |
The unique rows/values of x.
## create example data set d <- data.frame( x = rnorm(1000), y = seq.POSIXt(as.POSIXct("2018-01-01"), as.POSIXct("2018-12-31"), length.out = 10) ) ## sample to create version with duplicates dd <- d[c(1:1000, sample(1:1000, 500, replace = TRUE)), ] ## get only unique rows head(funique(dd)) ## check output identical(unique(dd), funique(dd))
## create example data set d <- data.frame( x = rnorm(1000), y = seq.POSIXt(as.POSIXct("2018-01-01"), as.POSIXct("2018-12-31"), length.out = 10) ) ## sample to create version with duplicates dd <- d[c(1:1000, sample(1:1000, 500, replace = TRUE)), ] ## get only unique rows head(funique(dd)) ## check output identical(unique(dd), funique(dd))