Specifically,
I used the following set up:
newdata <- tapply(mydata(#), list(mydata(X), mydata(Y)), sum)
I currently have a table that currently is listed as follows:
X= State, Y= County within State, #= a numerical total of something
- __ Y1 Y2 Y3 Yn
- X1 ## ## ## ##
- X2 ## ## ## ##
- X3 ## ## ## ##
- Xn ## ## ## ##
What I need is a table listed as follows:
- X1 Y1 ##
- X1 Y2 ##
- X1 Y3 ##
- X1 Yn ##
- X2 Y1 ##
- X2 Y2 ##
- X2 Y3 ##
- X2 Yn ##
- Xn Y1 ##
- Xn Y2 ##
- Xn Y3 ##
- Xn Yn ##