Skip to content
Prev 76127 / 398502 Next

correlation by subset

Krishna wrote:
Yes.  For example, the FUN argument to by() can be a summary of a 
linear model:

by(warpbreaks, warpbreaks$tension, function(x) summary(lm(breaks ~ wool, 
data=x)))