Skip to content

Instantly share code, notes, and snippets.

@t-student
Last active October 14, 2015 05:55
Show Gist options
  • Save t-student/e0b56cfa033387c56ec7 to your computer and use it in GitHub Desktop.
Save t-student/e0b56cfa033387c56ec7 to your computer and use it in GitHub Desktop.
library(plyr)
modspec <- function(df) {
summary(lm(sbp ~ age , data = df))
}
dlply(df1, .(gender), modspec)
# Produces a model as specified by modspec for gender (male and female)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment