powered by
Create an object of class "poly" from two vectors or from a matrix.
"poly"
as.poly(x, y=NULL)
An object of class "poly", i.e a two-columns matrix labelled "xcoord", "ycoord".
vector of x-coordinates or two-columns matrix
vector of y-coordinates when 'x' is a vector.
crpoly
# A triangle a <- as.poly(matrix(c(2,2,2,3,3,3), ncol=2, byrow=TRUE))
Run the code above in your browser using DataLab