I think you could get this done with the function "tapply", but it's not
clear because you don't give an example of your data. If tapply is not
the answer, certainly there is a way that is better than resorting to
doing it 'by hand' (brute force).
See ?tapply
Best,
Erik Iverson
tieflingrogue
I have a data set which has, let's say, income by state. I'm trying to
output income quartiles for each state into an array by doing a loop so that
I don't have to do it state by state by hand.
ie, something like
for (i in 1:50) {
quantile(subset(data,state==i)$income) -> r[i,5] }
where
2 matches
Mail list logo