Learn R Programming

shipunov (version 1.0)

Hulls: Groups' hulls

Description

Groups' hulls with centroids calculation

Usage

Hulls(pts, groups, match.color=TRUE, usecolors=NULL, plot=TRUE, centers=FALSE,
 c.pch=0, c.cex=3, ...)

Arguments

pts

Data points to plot

groups

Grouping variable (mumerical)

match.color

Match color

usecolors

Use colors (palette)

plot

Plot?

centers

Show centers?

c.pch

Color of center points

c.cex

Scale of center points

...

Arguments to 'lines()'

Value

Invisibly outputs list of hulls with coordinates

Details

Groups' hulls with optoinal centroids calculation (requires 'PBSmapping')

See Also

Ellipses

Examples

Run this code
# NOT RUN {
iris.p <- prcomp(iris[, 1:4], scale=TRUE)$x[, 1:2]
plot(iris.p, type="n", xlab="PC1", ylab="PC2")
pal <- rainbow(3)
text(iris.p, labels=abbreviate(iris[, 5], 1, method="both.sides"),
 col=pal[as.numeric(iris[, 5])])
Hulls(iris.p[, 1:2], as.numeric(iris[, 5]), centers=TRUE, usecolors=pal)
# }

Run the code above in your browser using DataLab