Skip to content
Prev 360103 / 398503 Next

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

You're right, but I think this fails to pinpoint the error. The
problem is that FUN's argument is  "applied to (usually data-frame)
subsets of data,"  and the OP has used FUN = mean, which takes a
vector (+ a few other classes), not a data frame, as argument. See
?mean

Morals:

1.  It is rather presumptuous to think that long used, well-tested,
core R functionality like by() have bugs; a (new?) user's first
thought should be to assume it is HIS error, not R's.


2. DO read the Help docs carefully. They are often terse, but usually
they mean what they (appear to) say.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Thu, Apr 14, 2016 at 2:36 PM, Adrian Du?a <dusa.adrian at unibuc.ro> wrote: