Hi All,

I have a data.frame:

>pop

    consumed ind recruits   gonad cell
1    516.74   1     0.02    20.21 0.25
2   1143.20   1     0.02    20.21 0.50
3    250.00   1     0.02    20.21 0.25
4    251.98   1     0.02    18.69 0.25
5    598.08   1     0.02    18.69 0.25
6    437.38   1     0.02    18.69 0.25
7    250.00   1     0.02    17.39 0.25
8    250.00   1     0.02    17.39 0.25
9    250.00   1     0.02    17.39 0.25
10   257.07   1     0.02    16.02 0.25

And I need to get the number of rows that sums a particular value (e.g. 2).

In my case above it would be 4 (the first 4 rows ==> sum(pop$cell)=2.

Any ideas?
THANKS

Nico


--

Nicolas L. Gutierrez

School of Aquatic and Fishery Sciences
1122 NE Boat St, Seattle, WA 98105

Lab:    +1 206 221 5457
Home:   +1 206 290 3858
www.fish.washington.edu

______________________________________________
R-help@r-project.org 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.

Reply via email to