Learn R Programming

vectools (version 0.3.0)

15_simple_geometric_objects: Simple Geometric Objects.

Description

Points, lines, polygons and text, as S4 objects.

These can be plotting using either the base or grid graphics systems.

NOTE: INTERNAL STRUCTURE OF OBJECTS IS SUBJECT TO CHANGE. DO NOT USE SLOTS, DIRECTLY.

Usage

Points (x, y, z=NULL, …, glist = list () )
Line (x, y, z=NULL, …, glist = list () )
Polygon (x, y, z=NULL, …, glist = list () )
Text (text, x, y, z=NULL, …, glist = list () )

as.Points (v, …) as.Line (v, …) as.Polygon (v, …)

Arguments

x, y, z

Equal length numeric vectors, giving coordinates. If z missing, a 2d object, otherwise, a 3d object.

v

Currently, a two or three column matrix.

text

A character vector of labels. x, y and z, need to be the same length.

glist

Argument list for plotting functions.

Ignored.

Value

Each function returns an S4 object with the corresponding class name. e.g. Line returns a Line object.

See Also

Grid, VImage

regPolygon

Examples

Run this code
# NOT RUN {
plot (Points (1:4, 1:4) )
# }

Run the code above in your browser using DataLab