Similar to unique, only optimized for working with date-time columns.

funique(x)

Arguments

x

Input data. If x is not a data frame or date-time object, then it is simply passed to unique

Value

The unique rows/values of x.

Examples

## 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))
#> x y #> 1 -1.400043517 2018-01-01 00:00:00 #> 2 0.255317055 2018-02-10 10:40:00 #> 3 -2.437263611 2018-03-22 22:20:00 #> 4 -0.005571287 2018-05-02 09:00:00 #> 5 0.621552721 2018-06-11 19:40:00 #> 6 1.148411606 2018-07-22 06:20:00
## check output identical(unique(dd), funique(dd))
#> [1] TRUE