View source: R/plot.parameters_pca.R
| plot.see_parameters_pca | R Documentation |
The plot() method for the parameters::principal_components() function.
## S3 method for class 'see_parameters_pca'
plot(
x,
type = "bar",
size_text = 3.5,
color_text = "black",
colors = c("#cd201f", "#ffffff", "#0077B5"),
size = 1,
show_labels = TRUE,
arrow_end_gap = 0.07,
factor_node_size = c(25, 35),
margins = c(0.3, 0.3),
names_factors = NULL,
fill_variables = "#738b8d",
fill_factors = "#2C3E50",
...
)
x |
An object. |
type |
Character vector, indicating the type of plot. Options are
different shapes to represent component loadings; |
size_text |
Numeric value specifying size of text labels. |
color_text |
Character specifying color of text labels. |
colors |
Character vector of length three, indicating the colors for low (negative), mid (close to zero), and high (positive) values. |
size |
Depending on |
show_labels |
Logical. If |
arrow_end_gap |
Numeric. Specifies the distance between the tip of the
edge arrow and the variable node. Adjusting this value prevents the arrow
from overlapping or clipping into the variable label. Default is |
factor_node_size |
Numeric vector of length 2. Determines the minimum
and maximum size of the circular factor nodes. Factor nodes are scaled
internally based on the proportion of variance they explain. This argument is
only used if |
margins |
Numeric vector of length 2. Adds extra space to the left and
right edges of the plot canvas (using |
names_factors |
Named character vector. Allows providing custom labels
for the factor nodes. The names of the vector must match the original factor
names generated by the model (e.g.,
|
fill_variables |
Character vector. Specifies the fill color for the
variable nodes (rectangular labels). Can be a single color hex/name (applied
to all variables), a vector of colors matching the exact number of variables,
or a named vector to map specific colors to specific variables. This argument
is only used if |
fill_factors |
Character vector. Specifies the fill color for the factor
nodes (circular points). Similar to |
... |
Arguments passed to or from other methods. |
A ggplot2-object.
library(parameters)
data(mtcars)
result <- principal_components(mtcars[, 1:7], n = "all", threshold = 0.2)
result
plot(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.