I am working with the maps package in R and I am having trouble calling states which have spaces in their names, since the data I am using lists each state without spaces. For example:
map("state", popdata[26,1], boundary = F, fill = T, col = 5, add = T)
where popdata[26,1] is NewHampshire
Gives me an error since the command requires the state to be denoted as New Hampshire (with the space).
Is there a way around this or a simple way to go through the data and add the appropriate spaces?
If you are certain that there will be a capital letter where the space should have been, use: