Re: [R] Replacing certain rows with values from a different column

2021-08-10 Thread Gerrit Eichner
Hi, James, if I understand you correctly, maybe, with(firstdf, ifelse(Province %in% seconddf$Country, Province, Country) ) does what you want? Hth -- Gerrit - Dr. Gerrit Eichner Mathem

[R] Replacing certain rows with values from a different column

2021-08-10 Thread James Milks via R-help
I have two columns in a larger data set that list countries in one column and, in some cases, individual provinces within a country or oversea territories in another. I have country population in a second data set that I’m planning to use to calculate per capita rates in the first data set. My i