Re: [R] performing operations on a dataframe

2009-11-06 Thread Uwe Ligges
Jim Lemon wrote: On 11/06/2009 05:30 AM, Lanna Jin wrote: 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

Re: [R] performing operations on a dataframe

2009-11-05 Thread Jim Lemon
On 11/06/2009 05:30 AM, Lanna Jin wrote: 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

Re: [R] performing operations on a dataframe

2009-11-05 Thread jim holtman
try this: > x <- read.table(textConnection("Year SpA + 2000 0 + 2000 2 + 2000 1 + 2001 8 + 2001 2 + 2001 0 + 2001 0 + 2002 1 + 2002 2"), header=TRUE) > closeAllConnections() > # convoluted if you want a 'function' for each year > l.func <- list('2000'=function(x) x / 146, +