Skip to content

Instantly share code, notes, and snippets.

@juba
Last active November 23, 2015 14:58
Show Gist options
  • Save juba/48f9f6b828b29e0257f6 to your computer and use it in GitHub Desktop.
Save juba/48f9f6b828b29e0257f6 to your computer and use it in GitHub Desktop.
library(dplyr)
d <- data.frame(x=rnorm(10), y=runif(10))
tab <- t(sapply(d, function(v) return(list(min=min(v),
"1st q"=quantile(v, 0.25),
median=median(v),
max=max(v)))))
tab <- data.frame(tab)
tab$name <- rownames(tab)
tab <- select(tab, name, everything() )
tab
write.csv(tab, file="foo.csv", row.names = FALSE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment