inst/doc/rAppendixShowbox1worldmap.r

# A. Load the package and understand region names
setwd("C:/aErer"); library(maps)
dat <- map(database = "world", plot = FALSE); str(dat)

# B. Display the map on the screen device
windows(width = 5.3, height = 2.5); bringToTop(stay = TRUE)
map(database = "world", fill = FALSE, col = "green", mar = c(0, 0, 0, 0))
map(database = "world", regions = c("Brazil", "China"), fill = TRUE,
  col = c("yellow", "red"), add = TRUE)
showWorld <- recordPlot()

# C. Save the map on a file device
pdf(file = "fig_showWorld.pdf", width = 5.3, height = 2.5)
replayPlot(showWorld); dev.off()

Try the erer package in your browser

Any scripts or data that you put into this service are public.

erer documentation built on April 18, 2022, 5:06 p.m.