search for: popdat

Displaying 1 result from an estimated 1 matches for "popdat".

2008 Oct 29
2
Help using tapply with multiple variables
...754 965 2 638 741 I want to use the tapply function to apply the pres.test function over all countries in my data table (the real data have ~150 countries and 10 age classes), but I can't seem to get tapply to take as input to FUN more than one variable, for example I tried: popdat<-cbind(dat2.sub$pop1995, dat2.sub$pop2000) #try to force the two time points into a vector form tapply(popdat, dat2.sub$country, pres.test, ...=list(N0=popdat[,1], N1=popdat[,2])) #tried to pass the other arguments that pres.test needs via ... And got the error: Error in tapply(popdat,...