I would like to represent multiple counties in TN state as a single region using a common color fill. I can do that with the code below:
library(maps)
map("state", "tennessee", fill = TRUE, col="white", names = TRUE, plot = TRUE)
co <- map("county",region = c("tennessee,williamson","tennessee,davidson",
"tennessee,wilson","tennessee,cheatham"),
col = "red", bg = "blue", fill = TRUE, plot = FALSE)
polygon(co$x, co$y, col = "yellow", border = "black")
But the black borders are drawn inside my region of interest. Is there a way to define the polygon function such that common county borders are not drawn in black?
Thank you.
map.poly()withas.polygon=FALSE, and then plot this withlines().map.poly()withas.polygon=TRUEand then plot this withpolygon()andborder=FALSE.You can see this if you look through the code of
mapby just entering it at the command line and hitting enter.Here is the code I used to get what you want:
From reading
?map, I thought simply doing something likemap(..., interior=F, fill=T, col='red')would work, but this doesn’t seem to do it. Could be a bug, but I haven’t played with this package enough to know for sure…