I originally tried to merge them using df <- merge(df1, df2, by = 'County')
but I get the aforementioned No data available in the table. I then tried to hand code it by: df[df$County==c("Alameda", "Amador", "Alpine), RUCC] <- 1
but then I got Error in x[[jj]] :
attempt to select less than one element in get1index
In addition: Warning message:
In ca1$County == c("Alameda", "Contra Costa", "El Dorado", "Los Angeles", :
longer object length is not a multiple of shorter object length
First, the initial command should work (though I suspect it won't do what you want it to do)
Second,
No data available in the table.
is not, to the best of my knowledge, an error message the merge() function (or any other function in R) throws. In fact, a Google search for the terms,
"no data available in the table" merge
yielded 7 results (including this question).
Lastly, your second attempt will definitely fail for a few reasons.
You are trying to subset a df object before creating it.
Even if df existed, you are trying to access a column RUCC, but you didn't put it in quotes, so unless you have an object in your environment named RUCC, you'd get an error about it not being found.