1
Hello, I am doing a work on HDI and Covid and I need to join two columns, the problem is that both are with number of different lines, and the reason is the number of municipalities in which each has, one more updated with less and the other older with more.
In both, I have the municipality code and I believe that with this I can exclude from the IDH dataset the lines of municipalities that the code is not in the Covid dataset.
But it’s not working, someone imagines how to do?
The columns of the HDI dataset: name, idhm_r, code
The COVID dataset columns: name, code, cases, Deaths
Both are already ordered by code.
Thank you very much!
In IDH is
nome
witho
and in Covidname
witha
? Anyway,i<-which(IDH$code %in% Covid$code)
followed byIDH2 <- IDH[i,]
selects HDI lines with codes in Covid.– Rui Barradas
Take a look at the documentation of
?dplyr::anti_join()
. Should help you.– Tomás Barcellos