I'm new to R so I'm still trying to figure things out.
I've got multiple raw datasets called with headers region
and populationXXXX
. The XXXX in the population header is the year.
All of the datasets have the exact same values in the region
column, the only difference is the values in the population
column which differ by year.
For example my first data set looks like this:
Region Population2000
1 Central Coast 85,000
2 South Coast 3,000
My second dataset looks like this:
Region Population2001
1 Central Coast 80,000
2 South Coast 4,000
I have 8 of these datasets (spanning from 2000 to 2007, and I would like to join them all into one and to look like this (I've only included the first two years):
Region Population2000 Population2001
1 Central Coast 85,000 80,000
2 South Coast 3,000 4,000
Is there an efficient way to do this without using multiple full joins based on region
?
Thanks!