draw.shape | R Documentation |
Draw shapefiles in an existing plot
draw.shape(shape, type = "poly", col = 1, ...)
shape |
a shape list object created by ( |
type |
type of plot desired. The following values are possible: |
col |
the colour of the points, lines or polygons |
... |
other arguments to be passed to |
The shapefile needs to have the WGS 84 Geographic Coordinate System in order to display properly on a map of longitude and latitude.
Hans Gerritsen
read.shapefile
library(shapefiles)
shp.file <- file.path(system.file(package = "mapplots", "extdata"), "Ireland")
irl <- read.shapefile(shp.file)
xlim <- c(-11,-5.5)
ylim <- c(51.5,55.5)
basemap(xlim, ylim)
draw.shape(irl, col="cornsilk")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.