Skip to content

Instantly share code, notes, and snippets.

@amoeba
Created December 2, 2009 03:13
Show Gist options
  • Save amoeba/246898 to your computer and use it in GitHub Desktop.
Save amoeba/246898 to your computer and use it in GitHub Desktop.
data <- read.csv("birth-data.csv")
data.sorted <- data[do.call(order, data[c("Pair.ID", "Birth.Order")]), ]
tapply(data.sorted$IQ,data.sorted$Pair.ID,function(x){x[2]-x[1]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment