[R] Help with map

Alberto Monteiro albmont at centroin.com.br
Fri May 4 15:24:15 CEST 2007


I have just learned how to play with map, but something weird
(or not) is happening.

Suppose I want to draw a map of two countries (that have disconnected
components), like Argentina and Brazil.

If I command:

library(maps)
library(mapdata)
map("worldHires", c("Argentina", "Brazil"))

It works fine. However, if I want to _colour_ the interior:

map("worldHires", c("Argentina", "Brazil"), c("cyan", "green"), fill=T)

Then the colors will be assigned to the islands (Marajo in Brazil's
North and Tierra del Fuego in Argentina's South) and there will be
a recycling.

Is there any way to associate one color to each country?

Alberto Monteiro



More information about the R-help mailing list