'R - Weird Issue - Cannot change a single data point

I have a little data set that was created with some coordinates and the rworldmap package (in order to give a country to every coordinate).

I am trying to change the name "United States of America" to "United States" so it matches up with the wrld_simpl data set from the maptools package, but it will not work. I get this error:

enter image description here

I understand that it's just a weird type of object, but I don't know how to adjust it, since the normal way does not seem to work.

Any help with this is appreciated.

Thank you!

r


Solution 1:[1]

Looks like meteorfell$country is a factor so you won't be able to add levels to it that way. Instead, try converting country to a character vector and then editing it:

    %>%
mutate(country=as.character(country))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dubukay