Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement preduce? #163

hadley opened this issue Jan 12, 2016 · 1 comment


Copy link

commented Jan 12, 2016

Parallel reduce would allow you to specific arguments that varied across each call. Would be useful if you want to collapse many joins. Need to think if we could have some convention for naming input elements and matching with arguments.

@hadley hadley added the feature label Mar 3, 2017


This comment has been minimized.

Copy link
Member Author

commented Mar 8, 2017

Note that the presence of init changes how the arguments align:

out <- init
out <- f(out, x[[1]], y[[1]])
out <- f(out, x[[2]], y[[2]])

out <- x[[1]]
out <- f(out, x[[2]], y[[1]])
out <- f(out, x[[3]], y[[2]])

To match pmap() the call might look like:

preduce(list(dfs, vars), left_join, ...) 

but vars would have length one less than dfs (which makes sense because of fence-posting). Maybe also need reduce2():

reduce2(dfs, vars, left_join, ...)

Maybe just start with reduce2() and leave preduce() for now? Seems harder to imagine use case given reduce2().

@hadley hadley closed this in 2d7fd45 Mar 8, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.