Ellie Roxburgh
Ellie Roxburgh

Reputation: 11

Plotting a world map on R without ggplot2

I'm trying to plot a world map on R but I don't have the version updated for ggplot2. Is there a way of doing it without?

Upvotes: 0

Views: 959

Answers (1)

G5W
G5W

Reputation: 37641

You can get an extremely simple world map with:

library(maps)
map('world', fill = TRUE, col = 2:8, wrap=c(-180,180) )

Simple World map

And a somewhat better map from the mapdata package

library(mapdata)
map('worldHires', fill=TRUE, col=2:8)

HiRes World

And just for fun, here is a version with prettier colors, a blue ocean and cutting out Antarctica.

RegHR <- map("worldHires", namesonly=TRUE, plot=FALSE)
map('worldHires', fill=TRUE, col=terrain.colors(6),  bg="#CCEEFF",
    region=RegHR[-grep("Antarctica", RegHR)])

Prettier World Map

Upvotes: 7

Related Questions