[R] function by

Emilie Berthiaume Emilie.Berthiaume at USherbrooke.ca
Thu Sep 30 18:05:53 CEST 2004


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

Tél: 1-819-821-8000 poste 2059
Fax: 1-819-821-8049
Emilie.Berthiaume at USherbrooke.ca

More information about the R-help mailing list