Learn R Programming

RCALI (version 0.3.7)

crpoly: Create un object of class 'poly' by clicking on points

Description

Create un object of class "poly" by clicking on a graphic: the locations of the clicks will be the vertices of the polygon.

Usage

crpoly()

Arguments

Value

An object of class "poly" i.e a two-columns matrix with the coordinates.

Warning

A plot should be drawn on the current graphics device before.

Details

The system prompts the user to enter points on the current graphic using the mouse or other pointing device. The points are joined on the screen with the current line symbol. A polygon of the points entered is drawn on the current graphics device and returned as a 'poly' object.

See Also

as.poly, getpoly of the package splancs

Examples

Run this code
if (FALSE) plot(x=c(1,10), y=c(1,10), type='n')
if (FALSE) a<-crpoly()
#    Enter points with button 1
#    Finish with button 2

Run the code above in your browser using DataLab