Learn R Programming

mapplots (version 1.5.2)

draw.shape: Draw shapefiles in an existing plot

Description

Draw shapefiles in an existing plot

Usage

draw.shape(shape, type = "poly", col = 1, ...)

Arguments

shape

a shape list object created by (shapefiles

type

type of plot desired. The following values are possible: "p" for points, "l" or "lines" for lines and "poly" (default) for polygons.

col

the colour of the points, lines or polygons

...

other arguments to be passed to points, lines or polygon

Author

Hans Gerritsen

See Also

read.shapefile

Examples

Run this code
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")

Run the code above in your browser using DataLab