[R] function by
Witold Eryk Wolski
wolski at molgen.mpg.de
Thu Sep 30 18:21:23 CEST 2004
?by
FUN: a function to be applied to data frame subsets of 'data'.
...: further arguments to 'FUN'.
by (SS, year, sum)
/E
Emilie Berthiaume wrote:
>Hi,
>
>I'm just getting started with R and I'm having problems with some simple
>operations: I want to get the the sum of the column "SStot" for each year using
>the function by. The data set is named "SS". I've tried this:
>
>by (SS, year, sum(SStot))
>
>and it's not working. Is it because there's a different number of rows for each
>year? How else can I do this?
>
>--
>Emilie Berthiaume
>Graduate student
>Biology Departement
>Université de Sherbrooke
>2500 boul. de l'Université
>Sherbrooke, Québec
>J1K 2R1 CANADA
>
>Tél: 1-819-821-8000 poste 2059
>Fax: 1-819-821-8049
>Emilie.Berthiaume at USherbrooke.ca
>
>______________________________________________
>R-help at 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
>
>
>
--
Dipl. bio-chem. Witold Eryk Wolski
MPI-Moleculare Genetic
Ihnestrasse 63-73 14195 Berlin _
tel: 0049-30-83875219 'v'
http://www.molgen.mpg.de/~wolski / \
mail: witek96 at users.sourceforge.net ---W-W----
wolski at molgen.mpg.de
More information about the R-help
mailing list