Skip to content

Instantly share code, notes, and snippets.

@krlmlr
Created April 15, 2014 10:12
Show Gist options
  • Save krlmlr/10720042 to your computer and use it in GitHub Desktop.
Save krlmlr/10720042 to your computer and use it in GitHub Desktop.
library(reshape2)
N <- 100000L
d.m <- data.frame(q1=runif(N), q2=runif(N), q3=runif(N),
f=sample(letters, N, replace=T), w=runif(N))
print(head(d.m))
print(summary(d.m))
sessionInfo()
d.c <- dcast(d.m, ...~f, sum, value.var="w")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment