The following code gives very unexpected results.
I'm trying to colour a few countries with different colours in a map of Asia, and the colors are all jumbled up. What am I doing wrong?
library(maps)
data(world.cities)
ctrys1=c("China","India","Australia","Taiwan","Malaysia","Thailand","Japan","Singapore","South Korea","Indonesia","Hong Kong")
cols=c('red','orange','white','white','white','white','white','red','white','white','white')
a=map('world',regions=ctrys1,ylim=c(-50,55),xlim=c(70,180),mar=c(0,0,0,0),fill=1,col=cols)
I've searched SO an the answers here fill countries in a world map or this link from the r choropleth challenge don't seem to have an answer for this. I suspect it is because the regions aren't obvious but I'm not clear how to extract them.