Hey all,

I feel like the solution to this problem should be relatively simple, but
for some reason I can't find answers or come up with my own solution.

Given the dataframe:
(SpA and SpB not important, want to look at distribution of cooccurance for
each year)

Year SpA SpB Coocc
2000  0
2000  2
2000  1
2001  8
2001  2
2001  0
2001  0
2002  1
2002  2

How can I apply different functions to the Coocc of each year?
(Note: Different lengths for each year, ie,
length(Year==2000)!=length(Year==2001))
For example, if Year==2000, function(x) x/146; if Year=2001, function(x)
x/237; etc.

I've figured out the long convoluted way, but since I plan to operate
numerous transformations on the different years, is there some way to solve
this in just a few steps?

Thanks for your answer in advance!


Lanna

	[[alternative HTML version deleted]]


