I'm not sure how to best explain what I am after but here goes. I have a data
frame with 2 geographical factors. One is the major region the other is the
component regions.
I am trying to process all the regions at the same time without using for. So
I need (think, I do) a list of matrices
I wrote a function that created the crosstab and removed the extraneous lines
and then used lapply
aestabs - function(x){
temp - xtabs(psn ~ lga + year,x)
temp - temp[rowSums(temp) != 0,]
return(temp)
}
eas2 - lapply(split(ipi$eas,ipi$eas$RegionNum),aestabs)
It's not really