Learn R Programming

ggfacto (version 0.3.2)

ggpca_cor_circle: Correlation Circle Plot for Principal Component Analysis

Description

Correlation Circle Plot for Principal Component Analysis

Usage

ggpca_cor_circle(
  res.pca,
  axes = c(1, 2),
  proj = FALSE,
  interactive = TRUE,
  text_size = 3
)

Value

A ggplot.

Arguments

res.pca

The result of FactoMineR::PCA.

axes

The axes to print, as a numeric vector of length 2.

proj

Set to `TRUE` to print projections of vectors over the two axes.

interactive

By default an html interactive plot is done. Set to `FALSE` to get a normal ggplot graph.

text_size

Size of the texte.

Examples

Run this code

data(mtcars, package = "datasets")
mtcars <- mtcars[1:7] |> dplyr::rename(weight = wt)
res.pca <- FactoMineR::PCA(mtcars, graph = FALSE)
ggpca_cor_circle(res.pca, interactive = FALSE)

Run the code above in your browser using DataLab