Skip to content

Instantly share code, notes, and snippets.

@drewlanenga
Last active August 29, 2015 13:56
Show Gist options
  • Save drewlanenga/9062570 to your computer and use it in GitHub Desktop.
Save drewlanenga/9062570 to your computer and use it in GitHub Desktop.
Example RHadoop MR Task
library(rmr2)
groups <- rbinom(32, n = 50, prob = 0.4)
print(groups)
groups.dfs <- to.dfs(groups)
from.dfs(
mapreduce(
input = groups.dfs,
map = function(., v) keyval(v, 1),
reduce =
function(k, vv)
keyval(k, length(vv))
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment