Plots row/individual principal coordinates.
Usage
viz_individuals(x, ...)
viz_rows(x, ...)
# S4 method for class 'MultivariateAnalysis'
viz_rows(
x,
...,
axes = c(1, 2),
active = TRUE,
sup = TRUE,
labels = FALSE,
highlight = NULL,
color = NULL,
symbol = 16,
size = c(1, 3),
xlim = NULL,
ylim = NULL,
main = NULL,
sub = NULL,
panel.first = NULL,
panel.last = NULL,
legend = list(x = "topleft")
)
# S4 method for class 'BootstrapCA'
viz_rows(x, ..., axes = c(1, 2))
# S4 method for class 'PCA'
viz_individuals(
x,
...,
axes = c(1, 2),
active = TRUE,
sup = TRUE,
labels = FALSE,
highlight = NULL,
color = NULL,
symbol = 16,
size = c(1, 3),
xlim = NULL,
ylim = NULL,
main = NULL,
sub = NULL,
panel.first = NULL,
panel.last = NULL,
legend = list(x = "topleft")
)
Arguments
- x
- ...
Further graphical parameters (see details).
- axes
A length-two
numeric
vector giving the dimensions to be plotted.- active
A
logical
scalar: should the active observations be plotted?- sup
A
logical
scalar: should the supplementary observations be plotted?- labels
A
logical
scalar: should labels be drawn? Labeling a large number of points can be computationally expensive and make the graph difficult to read. A selection of points to label can be provided using alist
of two named elements,how
(a string specifying how to select the labels to be drawn) andn
(an integer specifying the number of labels to be drawx). See examples below.- highlight
A vector specifying the information to be highlighted. If
NULL
(the default), no highlighting is applied. If a singlecharacter
string is passed, it must be the name of a categorical variable, or one of "observation
", "mass
", "sum
", "contribution
" or "cos2
" (seeaugment()
).- color
The colors for lines and points (will be mapped to
highlight
).- symbol
A vector of plotting characters or symbols.
- size
A length-two
numeric
vector giving range of possible sizes (greater than 0; (will be mapped tohighlight
).- xlim
A length-two
numeric
vector giving the x limits of the plot. The default value,NULL
, indicates that the range of the finite values to be plotted should be used.- ylim
A length-two
numeric
vector giving the y limits of the plot. The default value,NULL
, indicates that the range of the finite values to be plotted should be used.- main
A
character
string giving a main title for the plot.- sub
A
character
string giving a subtitle for the plot.- panel.first
An
expression
to be evaluated after the plot axes are set up but before any plotting takes place. This can be useful for drawing background grids.- panel.last
An
expression
to be evaluated after plotting has taken place but before the axes, title and box are added.- legend
A
list
of additional arguments to be passed tographics::legend()
; names of the list are used as argument names. IfNULL
, no legend is displayed.
Value
viz_*()
is called for its side-effects: it results in a graphic
being displayed. Invisibly returns x
.
See also
Other plot methods:
biplot()
,
screeplot()
,
viz_contributions()
,
viz_variables()
,
viz_wrap
,
wrap
Examples
## Load data
data("iris")
## Compute principal components analysis
X <- pca(iris, scale = TRUE)
#> 1 qualitative variable was removed: Species.
## Plot individuals
viz_individuals(X, panel.last = graphics::grid())
## Labels of the 10 individuals with highest cos2
viz_individuals(X, labels = list(how = "cos2", n = 10))
## Plot variables
viz_variables(X, panel.last = graphics::grid())
## Graphical parameters
## Continuous values
viz_individuals(X, highlight = iris$Petal.Length, symbol = 16, size = c(1, 2))
viz_individuals(X, highlight = iris$Petal.Length, symbol = 16, size = c(1, 2),
color = grDevices::hcl.colors(12, "RdPu"))
viz_variables(X, highlight = "contribution",
color = grDevices::hcl.colors(12, "BluGrn", rev = TRUE),
size = c(0, 1))
## Discrete values
viz_individuals(X, highlight = iris$Species, symbol = 21:23)
viz_individuals(X, highlight = iris$Species, symbol = 21:23,
fill = c("#004488", "#DDAA33", "#BB5566"),
color = "black")
viz_variables(X, highlight = c("Petal", "Petal", "Sepal", "Sepal"),
color = c("#EE7733", "#0077BB"),
symbol = c(1, 3))