
Last chance! 50% off unlimited learning
Sale ends in
Plots column/variable principal coordinates.
viz_variables(x, ...)viz_columns(x, ...)
# S4 method for MultivariateAnalysis
viz_columns(
x,
...,
axes = c(1, 2),
active = TRUE,
sup = TRUE,
labels = FALSE,
extra_quali = NULL,
extra_quanti = NULL,
color = NULL,
fill = FALSE,
symbol = FALSE,
size = c(1, 6),
xlim = NULL,
ylim = NULL,
main = NULL,
sub = NULL,
panel.first = NULL,
panel.last = NULL,
legend = list(x = "topleft")
)
# S4 method for MultivariateBootstrap
viz_columns(
x,
...,
axes = c(1, 2),
color = FALSE,
fill = FALSE,
symbol = FALSE,
legend = NULL
)
# S4 method for PCA
viz_variables(
x,
...,
axes = c(1, 2),
active = TRUE,
sup = TRUE,
labels = list(filter = "contribution", n = 10),
extra_quali = NULL,
extra_quanti = NULL,
color = NULL,
symbol = NULL,
size = 1,
xlim = NULL,
ylim = NULL,
main = NULL,
sub = NULL,
panel.first = NULL,
panel.last = NULL,
legend = list(x = "topleft")
)
# S4 method for CA
viz_variables(
x,
...,
axes = c(1, 2),
active = TRUE,
sup = TRUE,
labels = FALSE,
extra_quali = NULL,
extra_quanti = NULL,
color = NULL,
fill = FALSE,
symbol = FALSE,
size = c(1, 6),
xlim = NULL,
ylim = NULL,
main = NULL,
sub = NULL,
panel.first = NULL,
panel.last = NULL,
legend = list(x = "topleft")
)
# S4 method for BootstrapPCA
viz_variables(
x,
...,
axes = c(1, 2),
color = FALSE,
fill = FALSE,
symbol = FALSE,
legend = NULL
)
viz_*()
is called for its side-effects: it results in a graphic
being displayed. Invisibly returns x
.
A CA
, MCA
or PCA
object.
Further graphical parameters.
A length-two numeric
vector giving the dimensions to be
plotted.
A logical
scalar: should the active observations be
plotted?
A logical
scalar: should the supplementary observations be
plotted?
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 a
list
of two named elements, filter
(a string specifying how to filter
the labels to be drawn) and n
(an integer specifying the number of labels
to be drawn). See examples below.
An optional vector of qualitative data for aesthetics mapping.
An optional vector of quantitative data for aesthetics
mapping. If a single character
string is passed, it must be one of
"observation
", "mass
", "sum
", "contribution
" or "cos2
"
(see augment()
).
The colors for lines and points (will be mapped to
extra_quanti
or extra_quali
; if both are set, the latter has priority).
Ignored if set to FALSE
. If NULL
, the default color scheme will be used.
The background colors for points (will be mapped to
extra_quanti
or extra_quali
; if both are set, the latter has priority).
Ignored if set to FALSE
.
A vector of plotting characters or symbols (will be mapped to
extra_quali
). This can either be a single character or an integer code for
one of a set of graphics symbols. If symbol
is a named a named vector,
then the symbols will be associated with their name within extra_quali
.
Ignored if set to FALSE
.
A length-two numeric
vector giving range of possible sizes
(greater than 0; will be mapped to extra_quanti
).
Ignored if set to FALSE
.
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.
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.
A character
string giving a main title for the plot.
A character
string giving a subtitle for the plot.
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.
An expression
to be evaluated after plotting has taken
place but before the axes, title and box are added.
A list
of additional arguments to be passed to
graphics::legend()
; names of the list are used as argument names.
If NULL
, no legend is displayed.
N. Frerebeau
## Load data
data("iris")
## Compute principal components analysis
X <- pca(iris, scale = TRUE, sup_quali = "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, extra_quanti = iris$Petal.Length, symbol = 16, size = c(1, 2))
viz_individuals(X, extra_quanti = iris$Petal.Length, symbol = 16, size = c(1, 2),
color = grDevices::hcl.colors(12, "RdPu"))
viz_variables(X, extra_quanti = "contribution",
color = grDevices::hcl.colors(12, "BluGrn", rev = TRUE),
size = c(0, 1))
## Discrete values
viz_individuals(X, extra_quali = iris$Species, symbol = 21:23)
viz_individuals(X, extra_quali = iris$Species, symbol = 21:23,
fill = c("#004488", "#DDAA33", "#BB5566"),
color = "black")
viz_variables(X, extra_quali = c("Petal", "Petal", "Sepal", "Sepal"),
color = c("#EE7733", "#0077BB"),
symbol = c(1, 3))
Run the code above in your browser using DataLab