viz_confidence | R Documentation |
Plots confidence ellipses.
viz_confidence(x, ...)
wrap_confidence(x, ...)
## S4 method for signature 'MultivariateAnalysis'
viz_confidence(
x,
...,
margin = 1,
axes = c(1, 2),
group = NULL,
level = 0.95,
color = NULL,
fill = FALSE,
symbol = FALSE
)
## S4 method for signature 'BootstrapCA'
viz_confidence(
x,
...,
margin = 1,
axes = c(1, 2),
level = 0.95,
color = FALSE,
fill = FALSE,
symbol = FALSE
)
## S4 method for signature 'PCOA'
viz_confidence(
x,
...,
axes = c(1, 2),
group = NULL,
level = 0.95,
color = NULL,
fill = FALSE,
symbol = FALSE
)
## S4 method for signature 'MultivariateAnalysis'
wrap_confidence(x, margin = 1, axes = c(1, 2), group = NULL, level = 0.95)
## S4 method for signature 'PCOA'
wrap_confidence(x, axes = c(1, 2), group = NULL, level = 0.95)
x |
An object from which to wrap observations (a |
... |
Further graphical parameters to be passed to
|
margin |
A length-one |
axes |
A length-two |
group |
A vector specifying the group an observation belongs to. |
level |
A |
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 |
wrap_confidence()
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_confidence()
is called for its side-effects: it results in a graphic
being displayed. Invisibly returns x
.
N. Frerebeau
Other envelopes:
viz_ellipses()
,
viz_hull()
,
viz_tolerance()
## Load data
data("iris")
## Compute principal components analysis
X <- pca(iris, scale = TRUE, sup_quali = "Species")
## Compute confidence ellipse coordinates
conf <- wrap_confidence(X, margin = 1, group = "Species", level = 0.95)
## Plot confidence ellipses
col <- c("#004488", "#DDAA33", "#BB5566")
viz_rows(X, extra_quali = iris$Species, color = col)
viz_confidence(X, group = iris$Species, color = col, level = 0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.