I have a dataframe that contains year
, state
, and organization type
. The years range from 1970-2018, and there are 6 (or so) types of organizations. I want to separate this dataframe by year and organization.
An example of what I have:
Year State Type
1970 AL A
1970 AK B
.....
.....
1975 OH D
What I would like:
Dataframe 1
1970 AL A
1970 AK A
Dataframe 2
1971 AL A
1971 AK A
Dataframe 50
1970 AL G
1970 AK G
Dataframe 55
2018 AL G
2018 AK G
I have thought some loop/while function could work but have not figured it out. I could subset manually but that will take a lot of time. Thank you for your help.