I have a data frame, and one of the columns is a mislabeled continent value called americas. I want to reassign all values with United States and Canada as North America, and Every other value labeled as Americas to be reassigned as South America.
for (i in g2$country){
if (i == "United States") {
g2$continent == 'North America"
}
}