I have one data frame that has five columns (fips, SCC, Emissions, County, Solvent)
and another data frame that corresponds to these five columns (fips, SCC, Pollutant, Emissions, type, year)
. I am wanting to grab the year from the second data set and add it as a column to the other one.
I was thinking the best way to do it would be to look at both the Emissions
and SCC
as these together should create a unique identifier. Then I can get the index of where these match together, and then create a function that returns the corresponding year
, and finally use sapply
to get all of the years in the correct order. Can someone let me know how I can get the correct row index?