draw.shape: Draw shapefiles in an existing plot

View source: R/draw.shape.R

draw.shapeR Documentation

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

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

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")

mapplots documentation built on Aug. 25, 2023, 5:15 p.m.