Draw shapefiles in an existing plot

Share:

Description

Draw shapefiles in an existing plot

Usage

1
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

Note

The shapefile needs to have the WGS 84 Geographic Coordinate System in order to display properly on a map of longitude and latitude.

Author(s)

Hans Gerritsen

See Also

read.shapefile

Examples

1
2
3
4
5
6
7
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")