Re: [R] Mean error message missing

2015-06-08 Thread Christian Brandstätter
Thank you very much, I didn't know that. On 08/06/2015 6:04 AM, Christian Brandstätter wrote: Thank you for the explanation. But if you take for instance plot.default(), being another generic function, it would not work like that: plot(1,2,3,4), only plot(1,2) is accepted. From R-help (Usag

Re: [R] Mean error message missing

2015-06-08 Thread Duncan Murdoch
On 08/06/2015 6:04 AM, Christian Brandstätter wrote: > Thank you for the explanation. > But if you take for instance plot.default(), being another generic > function, it would not work like that: > plot(1,2,3,4), only plot(1,2) is accepted. > > > From R-help (Usage): > ## Default S3 method: > m

Re: [R] Mean error message missing

2015-06-08 Thread Christian Brandstätter
Thank you for the explanation. But if you take for instance plot.default(), being another generic function, it would not work like that: plot(1,2,3,4), only plot(1,2) is accepted. From R-help (Usage): ## Default S3 method: mean(x, trim = 0, na.rm = FALSE, ...) What is puzzling, is that apparen

Re: [R] Mean error message missing

2015-06-08 Thread Achim Zeileis
On Mon, 8 Jun 2015, Christian Brandstätter wrote: Dear list, I found an odd behavior of the mean function; it is allowed to do something that you probably shouldn't: If you calculate mean() of a sequence of numbers (without declaring them as vector), mean() then just computes mean() of the fi

[R] Mean error message missing

2015-06-08 Thread Christian Brandstätter
Dear list, I found an odd behavior of the mean function; it is allowed to do something that you probably shouldn't: If you calculate mean() of a sequence of numbers (without declaring them as vector), mean() then just computes mean() of the first element. Is there a reason why there is no warn