as.poly: Create an object of class 'poly'

View source: R/poly-methods.R

as.polyR Documentation

Create an object of class 'poly'

Description

Create an object of class "poly" from two vectors or from a matrix.

Usage

as.poly(x, y=NULL)

Arguments

x

vector of x-coordinates or two-columns matrix

y

vector of y-coordinates when 'x' is a vector.

Value

An object of class "poly", i.e a two-columns matrix labelled "xcoord", "ycoord".

See Also

crpoly

Examples

# A triangle
a <- as.poly(matrix(c(2,2,2,3,3,3), ncol=2, byrow=TRUE))

RCALI documentation built on Jan. 13, 2023, 5:12 p.m.