Skip to content
Prev 360105 / 398503 Next

Bug in by() function which works for some FUN argument and does not work for others

Hi Dr Singh,
The object mtcars is a data frame and the mean is not defined for a
data frame. If you try it on a component of the data frame for which
mean is defined:

 by(mtcars$mpg,mtcars$am,mean)
mtcars$am: 0
[1] 17.14737
------------------------------------------------------------
mtcars$am: 1
[1] 24.39231

Jim

On Fri, Apr 15, 2016 at 6:14 AM, Akhilesh Singh
<akhileshsingh.igkv at gmail.com> wrote: