[R] Using add1() as the FUN argument to by()

From: Chuck Cleland <ccleland_at_optonline.net>
Date: Fri 06 May 2005 - 02:54:23 EST


Why does the following not work?

by(warpbreaks, warpbreaks$tension, function(x) add1(lm(breaks ~ 1, data=x), ~ . + wool))

Error in inherits(x, "data.frame") : Object "x" not found

Is there another efficient way to apply add1() to subsets of a data frame?

Thanks.

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Fri May 06 02:59:56 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:36 EST