On 20/08/2007, at 9:54 PM, Tom Willems wrote: > dear Mathew > > mean is a Generic function > > mean(x...) > > in wich x is a data object, like a data frame a list a numeric > vector... > > so in your example it only reads the first character and then > reports it. > > try x = c(1,1,2) > mean(x)
I think you've completely missed the point. I'm sure Mathew now understands the syntax of the mean function. His point was that it would be very easy for someone to use this function incorrectly --- and he indicated very clearly *why*, by giving an example using max(). If mean() could be made safer to use by incorporating a warning, without unduly adding to overheads, then it would seem sensible to incorporate such a warning. Or to change the mean() function so that mean(1,2,3) returns ``2'' --- just as max (1,2,3) returns ``3'' --- as Mathew *initially* (and quite reasonably) expected it to do. cheers, Rolf Turner ###################################################################### Attention:\ This e-mail message is privileged and confidenti...{{dropped}} ______________________________________________ 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 and provide commented, minimal, self-contained, reproducible code.