funique {funique} | R Documentation |
A faster unique function
Description
Similar to unique
, only optimized for working with
date-time columns.
Usage
funique(x)
Arguments
x |
Input data. If x is not a data frame or date-time object, then it is
simply passed to |
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))
## check output
identical(unique(dd), funique(dd))
[Package funique version 0.0.1 Index]