draw.polygons: Draw polygons on the plot window

Description Usage Arguments Details Value

View source: R/draw.polygons.R

Description

Returns a SpatialPolygonsDataFrame object containing polygons drawn with the mouse on a plot

Usage

1
2
draw.polygons(n, draw.reg = TRUE, col = NULL, alpha = 0.5,
  prompt.labels = TRUE, ID = NULL, proj4string = CRS(as.character(NA)))

Arguments

n

Number of polygons to draw.

draw.reg

Whether to draw the polygons on the plot. TRUE/FALSE.

col

Color values for the polygons to be drawn. Ignored if draw.reg=FALSE.

alpha

Transparency of the colors (0..1). Ignored if draw.reg=FALSE.

prompt.labels

Whether to prompt for a label after each polygon is drawn (TRUE/FALSE). See Details.

ID

A character vector of length n of the ID values for each polygon

proj4string

An object of class CRS containing the coordinate system of the drawn polygons

Details

This function involves 'digitizing' polygons by clicking with the mouse, so it requires a plot window to be active. The number of polygons to be drawn must be specified by the argument n. If prompt.labels=FALSE, default IDs will be constructed for each polygon.

proj4string can be used if the current plot window is displaying geographic data.

Value

An object of class SpatialPolygonsDataFrame


tlocoh.dev documentation built on May 2, 2019, 5:20 p.m.