0

I have two datasets:

County   Year 
Alameda  2000
Alameda  2001
Alameda  2002
Alpine   2000
Alpine   2001
Alpine   2002
Amador   2000
Amador   2001
Amador   2002

And

County    RUCC_2013
Alameda   1
Alpine    8
Amador    6

I am trying to merge these two datasets so that I get:

County   Year    RUCC
Alameda  2000    1
Alameda  2001    1
Alameda  2002    1
Alpine   2000    8
Alpine   2001    8
Alpine   2002    8
Amador   2000    6
Amador   2001    6
Amador   2002    6

I tried your standard merge the two data frames to produce a new one but the new one has all the columns but has "No data available in the table." Is there a way to attach the RUCC value for the individual county from the first dataset to the all the years for each respective county in the other dataset?

fds112
  • 1
  • `new_df <- merge(df1, df2, by = 'County')` – Ronak Shah Aug 31 '20 at 02:34
  • That is the code I used but lead to the "No data available in the table." – fds112 Aug 31 '20 at 02:54
  • You should include the code that you have tried in your post. Moreover, when I create a dataframe using the data you have shared it gives the expected output and does not give `"No data available in the table."` for me. You should include the data using `dput` so that we can reproduce the same error as you. Here's a guide on how to do that http://stackoverflow.com/questions/5963269 – Ronak Shah Aug 31 '20 at 03:06

0 Answers0