Learn R Programming

IsoriX (version 0.4-1)

worldcountries: Borders of world countries

Description

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

Usage

data(worldcountries)

Arguments

Format

A SpatialPolygons

Source

This SpatialPolygons is derived from the world of the package maps. Please refer to this other package for description and sources of this dataset. See example for details on how we created the dataset.

See Also

oceanmask for another polygon shapefile used to embellish the plots

Examples

Run this code
data(worldcountries)

if(require(sp))
  plot(worldcountries, 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(worldcountries, run.dontrun=TRUE) )

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

Run the code above in your browser using DataLab