-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hi,
No issue but I wanted to share with you the function funique in package kit v0.0.4.
Please see benchmark below.
Thank you
## set seed
set.seed(20180812)
## generate data
d <- data.frame(
x = rnorm(1000),
y = seq.POSIXt(as.POSIXct("2018-01-01"),
as.POSIXct("2018-12-31"), length.out = 10))
## create data frame with duplicate rows
d <- d[c(1:1000, sample(1:1000, 500, replace = TRUE)), ]
row.names(d) <- NULL
## check the output against base::unique
identical(unique(d), funique::funique(d))
identical(unique(d), kit::funique(d))
## bench mark
microbenchmark::microbenchmark(
base=unique(d),
funique=funique::funique(d),
kit=kit::funique(d),
times = 100L,
unit = "relative"
)
# Unit: relative
# expr min lq mean median uq max neval
# base 217.17359 199.51080 166.76247 153.7226 168.03336 115.97128 100
# funique 35.25088 32.82433 27.81834 25.4809 25.24862 21.19788 100
# kit 1.00000 1.00000 1.00000 1.0000 1.00000 1.00000 100Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels