- X
an object of class PCA [FactoMineR]; prcomp and princomp [stats];
dudi and pca [ade4]; expoOutput/epPCA [ExPosition].
- ...
Additional arguments.
in fviz_pca_ind() and
fviz_pca_var(): Additional arguments are passed to the functions fviz() and
ggpubr::ggpar().
in fviz_pca_biplot() and fviz_pca(): Additional
arguments are passed to fviz_pca_ind() and fviz_pca_var().
- axes
a numeric vector of length 2 specifying the dimensions to be
plotted.
- geom
a text specifying the geometry to be used for the graph. Allowed
values are the combination of c("point", "arrow", "text"). Use
"point" (to show only points); "text" to show only labels;
c("point", "text") or c("arrow", "text") to show arrows and
texts. Using c("arrow", "text") is sensible only for the graph of
variables.
- geom.ind, geom.var
as geom but for individuals and variables,
respectively. Default is geom.ind = c("point", "text), geom.var =
c("arrow", "text").
- repel
logical; whether to use ggrepel to avoid overplotting text
labels. The old jitter argument is kept for backward
compatibility and is converted to repel = TRUE with a deprecation warning.
- habillage
an optional factor variable for coloring the observations by
groups. Default value is "none". If X is a PCA object from FactoMineR
package, habillage can also specify the supplementary qualitative variable
(by its index or name) to be used for coloring individuals by groups (see
?PCA in FactoMineR).
- palette
the color palette to be used for coloring or filling by
groups. Allowed values include "grey" for grey color palettes; brewer
palettes e.g. "RdBu", "Blues", ...; or custom color palette e.g. c("blue",
"red"); and scientific journal palettes from ggsci R package, e.g.: "npg",
"aaas", "lancet", "jco", "ucscgb", "uchicago", "simpsons" and
"rickandmorty". Can be also a numeric vector of length(groups); in this
case a basic color palette is created using the function
palette.
- addEllipses
logical value. If TRUE, draws ellipses around the
individuals when habillage != "none".
- col.ind, col.var
color for individuals and variables, respectively. Can
be a continuous variable or a factor variable. Possible values also include
"cos2", "contrib", "coord", "x", and "y". In this case, the colors for
individuals/variables are automatically controlled by their qualities of
representation ("cos2"), contributions ("contrib"), coordinates (x^2+y^2,
"coord"), x values ("x") or y values ("y"). To use automatic coloring (by
cos2, contrib, ....), make sure that habillage ="none".
- fill.ind, fill.var
same as col.ind and col.var but for the fill color.
- col.ind.sup
color for supplementary individuals
- alpha.ind, alpha.var
controls the transparency of individual and
variable colors, respectively. The value can vary from 0 (total
transparency) to 1 (no transparency). Default value is 1. Possible values
also include "cos2", "contrib", "coord", "x", and "y". In this case, the
transparency for the individual/variable colors are automatically
controlled by their qualities ("cos2"), contributions ("contrib"),
coordinates (x^2+y^2, "coord"), x values("x") or y values("y"). To use
this, make sure that habillage ="none".
- shape.ind
optional factor variable to map the point shape of
individuals, independently of their color. This allows colouring
individuals by one grouping variable (col.ind/habillage) and
shaping them by another (e.g. fviz_pca_ind(res, col.ind = group1,
shape.ind = group2)). Default NULL keeps the previous behaviour
(shape follows the colour grouping). Use + labs(shape = , colour = )
to rename the legends.
- select.ind, select.var
a selection of individuals/variables to be
drawn. Allowed values are NULL or a list containing the arguments name,
cos2 or contrib:
name: is a character vector containing
individuals/variables to be drawn
cos2: if cos2 is in [0, 1], ex:
0.6, then individuals/variables with a cos2 > 0.6 are drawn. if cos2 > 1,
ex: 5, then the top 5 individuals/variables with the highest cos2 are
drawn.
contrib: if contrib > 1, ex: 5, then the top 5
individuals/variables with the highest contrib are drawn
union:
logical. When several of name/cos2/contrib are given, FALSE (default)
combines them with AND (each condition further narrows the selection);
TRUE combines them with OR (an element is kept if it matches any
condition), e.g. named items plus the top-cos2 ones.
- max.points
integer or NULL. When the individual / row / column cloud has
more than max.points points, a random subset of that many points
is drawn so the plot stays readable (usable labels instead of an over-plotted
cloud). Only the drawn points/labels are thinned: any ellipse
(addEllipses) and the group mean point are still computed on the
full data, so a convex / confidence frame is not shrunk or inflated by
the draw. When points are coloured/split by a group (e.g. habillage),
the draw is stratified so every group keeps at least a minimum number
of points and none is decimated. When colour, fill or size is mapped to a
continuous metric (e.g. col.ind = "cos2"), its scale and legend are
pinned to the full-data range, so a point's colour, fill and size do not depend
on how many points are drawn. A message reports how many points are shown. The
subset is reproducible
(see sample.seed) and does not change the caller's random stream.
NULL (default) draws every point.
- sample.seed
the random seed used to pick the max.points subset,
for a reproducible figure. Ignored when max.points is NULL.
- col.quanti.sup
a color for the quantitative supplementary variables.
- col.circle
a color for the correlation circle. Used only when X is a
PCA output.
- gradient.cols
vector of colors to use for n-colour gradient. Allowed
values include brewer and ggsci color palettes.
- label
a text specifying the elements to be labelled. Default value is
"all". Allowed values are "all", "none", or a combination of c("ind", "ind.sup",
"quali", "var", "quanti.sup"). "ind" can be used to label only active
individuals. "ind.sup" is for supplementary individuals. "quali" is for
supplementary qualitative variables. "var" is for active variables.
"quanti.sup" is for quantitative supplementary variables.
- invisible
a text specifying the elements to be hidden on the plot.
Default value is "none". Allowed values are "all", "none", or a combination of c("ind",
"ind.sup", "quali", "var", "quanti.sup").
- title
the title of the graph
- biplot.type
type of biplot scaling for fviz_pca_biplot(). Options are:
"auto" (default): Uses range-based rescaling for visualization
"form": Gabriel form biplot scaling (equivalent to
stats::biplot(..., scale = 0)), preserving the score geometry
used to compare individuals.
"covariance": Gabriel covariance biplot scaling (equivalent to
stats::biplot(..., scale = 1)), preserving the variable
covariance geometry. Because both clouds share a single set of axes
(unlike stats::biplot()'s dual axes), the individuals can appear
compressed relative to the variable arrows; use "form" or "auto" if the
individual cloud is the focus.
Note: "form" and "covariance" scaling requires prcomp or princomp objects.