Learn R Programming

IsoriX (version 0.5)

countries: Borders of world countries

Description

This dataset contains a polygon shapefile that can be used to plot the borders of countries.

Usage

data(countries)

Arguments

Format

A SpatialPolygons

See Also

oceanmask for another polygon shapefile used to embellish the plots

Examples

Run this code
# NOT RUN {
data(countries)

if(require(sp))
  plot(countries, border="red", col="darkgrey")


### HOW DID WE CREATE THIS FILE?
### (This example takes some time and will therefore not be run
###  unless you type: example(countries, run.dontrun=TRUE) )

# }
# NOT RUN {
if(require(maps) & require(maptools) & require(raster) & require(rgeos)){
    worldmap <- map("world", fill=TRUE, plot=FALSE)
    countries <- map2SpatialPolygons(worldmap, IDs=worldmap$names)
    countries <- gBuffer(countries, byid=TRUE, width=0)
    proj4string(countries) <- CRS("+proj=longlat +datum=WGS84")
    countries
    ## uncomment the following to store the file:
    #save(countries, file="countries.rda", compress="xz")
}
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab