[R] Assigning fate percent to plots

Robin Gropp robingropp at lclark.edu
Wed Jul 15 21:12:03 CEST 2015


Hi.

I have a big data set which could be represented something like this:

*plot     fate*
1         S
2         M
3         S
3         S
3         M
4         S
4         S
5         S
5         M
5         S
5         S
6         M
7         M

where plot is a location, and fate is either "survivorship" or "mortality"
( a plant lives or dies.) Thus in plot 5 there are 4 plants. 3 of them
survive, 1 dies.
I want to figure out a way to make R calculate the fraction of individuals
that survive in each plot for all of these. It is proving very challenging.

Example: Plot 5 would return a survivorship value of 3/4 or 75%/
                Plot 3 would return a survivorship value of 2/3 or 66%

Any help would be much appreciated.
Thank you

	[[alternative HTML version deleted]]



More information about the R-help mailing list