Re: [R] Help using tapply with multiple variables

2008-10-29 Thread Dimitris Rizopoulos
try this: lapply(split(dat, dat$country), function (x) { pres.test(x$pop1995, x$pop2000) }) I hope it helps. Best, Dimitris Corey Sparks wrote: Dear list, I have the function (as a simple example, which is actually part of a larger function) pres.test<-function(N0=N0, N1=N1) { dt<

Re: [R] Help using tapply with multiple variables

2008-10-29 Thread Henrique Dallazuanna
Try this: split(mapply(function(x, y)pres.test(x, y), DF$pop1995, DF$pop2000), DF$country) On Wed, Oct 29, 2008 at 10:19 AM, Corey Sparks <[EMAIL PROTECTED]>wrote: > Dear list, > I have the function (as a simple example, which is actually part of a > larger function) > > pres.test<-function(N0=N

[R] Help using tapply with multiple variables

2008-10-29 Thread Corey Sparks
Dear list, I have the function (as a simple example, which is actually part of a larger function) pres.test<-function(N0=N0, N1=N1) { dt<-5 r<-log(N1/N0)/dt r } which calculates the annual growth rates in a population Where N0 is the population classified into age intervals, say