viz_hull {dimensio} | R Documentation |
Convex Hulls
Description
Plots convex hull of a set of observations.
Usage
viz_hull(x, y, ...)
wrap_hull(x, y, ...)
## S4 method for signature 'numeric,numeric'
viz_hull(x, y, ..., group = NULL, color = NULL, fill = FALSE, symbol = FALSE)
## S4 method for signature 'MultivariateAnalysis,missing'
viz_hull(x, ..., group = NULL, color = NULL, fill = FALSE, symbol = FALSE)
## S4 method for signature 'MultivariateBootstrap,missing'
viz_hull(x, ..., color = FALSE, fill = FALSE, symbol = FALSE)
## S4 method for signature 'PCOA,missing'
viz_hull(x, ..., group = NULL, color = FALSE, fill = FALSE, symbol = FALSE)
## S4 method for signature 'numeric,numeric'
wrap_hull(x, y, group = NULL)
## S4 method for signature 'MultivariateAnalysis,missing'
wrap_hull(x, margin = 1, axes = c(1, 2), group = NULL, principal = TRUE)
## S4 method for signature 'PCOA,missing'
wrap_hull(x, axes = c(1, 2), group = NULL)
Arguments
x , y |
A |
... |
Further graphical parameters to be passed to
|
group |
A vector specifying the group an observation belongs to. |
color |
The colors for borders (will be mapped to |
fill |
The background colors (will be mapped to |
symbol |
A vector of symbols (will be mapped to |
margin |
A length-one |
axes |
A length-two |
principal |
A |
Value
wrap_hull()
returns a data.frame
of envelope x
and y
coordinates.
An extra column named group
is added specifying the group an observation
belongs to.
viz_hull()
is called for its side-effects: it results in a graphic being
displayed. Invisibly returns x
.
Author(s)
N. Frerebeau
See Also
Other envelopes:
viz_confidence()
,
viz_ellipses()
,
viz_tolerance()
Examples
## Load data
data("iris")
## Compute principal components analysis
X <- pca(iris, scale = TRUE, sup_quali = "Species")
## Compute convex hull coordinates
hulls <- wrap_hull(X, margin = 1, group = "Species")
## Plot convex hulls
col <- c("#004488", "#DDAA33", "#BB5566")
viz_rows(X, extra_quali = iris$Species, color = col)
viz_hull(X, group = iris$Species, color = col)