[Rd] help text for ave()

Henrik Parn henrik.parn at bio.ntnu.no
Thu Jan 15 09:59:31 CET 2009


Dear R developers,

In the help text for ave() you can read in Arguments section:

"... Grouping variables, typically factors, all of the same length as x"

...and in Value: "If ... is g1,g2,".

I think a description in the Arguments section of how two or more 
grouping variables is specified together with an Example would be very 
helpful.

In absence of a help text I just tried if the equivalent specification 
in tapply would work:

data(warpbreaks)
str(warpbreaks)
'data.frame':   54 obs. of  3 variables:
  $ breaks : num  26 30 54 25 70 52 51 26 67 18 ...
  $ wool   : Factor w/ 2 levels "A","B": 1 1 1 1 1 1 1 1 1 1 ...
  $ tension: Factor w/ 3 levels "L","M","H": 1 1 1 1 1 1 1 1 1 2 ...

ave(x = breaks, list(wool, tension), FUN = median)

Is this THE way to specify two or more grouping variables in ave()? If 
yes, maybe it could be used as an example.


Thank you all for your great work developing R!


-- 
Henrik Pärn
Centre for Conservation Biology
Department of Biology
Norwegian University of Science and Technology
NO-7491 Trondheim
Norway

Office: +47 73596285
Fax: +47 73596100
Mobile: +47 90989255

E-mail: henrik.parn at bio.ntnu.no



More information about the R-devel mailing list