Created
February 13, 2023 09:16
-
-
Save gaborcsardi/cf4ee96e26358a53963c7485c1c33aae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## From https://github.com/szilard/benchm-dplyr-dt, thanks Szilárd! | |
library(dplyr) | |
n <- 100000000 | |
m <- 1000000 | |
d <- data.frame(x = sample(m, n, replace=TRUE), y = runif(n)) | |
dm <- data.frame(x = sample(m)) | |
r1 <- d %>% filter(x>=10, x<20) | |
r2 <- d %>% arrange(x) | |
r3 <- d %>% mutate(y2 = 2*y) | |
r4 <- d %>% group_by(x) %>% summarize(ym = mean(y)) | |
r5 <- d %>% inner_join(dm, by="x") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment