Created
April 14, 2015 19:55
-
-
Save cboettig/415959a2523687a55366 to your computer and use it in GitHub Desktop.
testing parallel dplyr::do
This file contains 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
library("nycflights13") | |
library("dplyr") | |
library("mgcv") | |
by_dest <- flights %>% group_by(dest) %>% filter(n() > 100) | |
system.time( | |
by_dest %>% do(smooth = gam(arr_delay ~ s(dep_time) + month, data = .)) | |
) | |
init_cluster(parallel::detectCores()) | |
system.time( | |
by_dest %>% do(smooth = gam(arr_delay ~ s(dep_time) + month, data = .)) | |
) | |
stop_cluster() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note:
dplyr::init_cluster()
and friends now appear in the documentation: http://rpackages.ianhowson.com/cran/dplyr/man/dplyr-cluster.html but don't seem to be implemented in thedo
method at this time.