###--- >>> `by' <<<----- Apply a Function to a Data Frame split by Factors

	## alias	 help(by)
	## alias	 help(by.default)
	## alias	 help(by.data.frame)
	## alias	 help(print.by)

##___ Examples ___:

data(warpbreaks)
attach(warpbreaks)
by(warpbreaks[, 1:2], tension, summary)
by(warpbreaks[, 1], list(wool=wool, tension=tension), summary)
by(warpbreaks, tension, function(x) lm(breaks ~ wool, data=x))

## now suppose we want to extract the coefficients by group
tmp <- by(warpbreaks, tension, function(x) lm(breaks ~ wool, data=x))
sapply(tmp, coef)

detach("warpbreaks")

## Keywords: 'iteration', 'category'.


