Skip to content

Instantly share code, notes, and snippets.

@flandr
Created October 3, 2014 18:12
Show Gist options
  • Save flandr/33694b29c0ac7d37b72c to your computer and use it in GitHub Desktop.
Save flandr/33694b29c0ac7d37b72c to your computer and use it in GitHub Desktop.
# Plot histograms from variable frame input
getplots <- function(...) {
frames <- list(...)
names <- as.list(substitute(list(...)))[-1]
# Find the max range
m <- max(sapply(frames, function(f) { max(f$len) }))
plots <- mapply(function(f,n) {
print(max(f$len))
qplot(f$len, xlab='commit msg len', xlim=c(0, m),
main=sprintf("%s repo", deparse(n)))
}, frames, names, SIMPLIFY=FALSE)
return(plots)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment