Package {EasyPCA}


Type: Package
Title: Principal Component Analysis with Automated Interpretation and Visualization
Version: 0.1.1
Description: Provides an automated workflow for Principal Component Analysis (PCA) that simplifies multivariate data analysis by performing essential preprocessing, statistical tests, component extraction, and visualization in a single function call. The package automatically standardizes variables, computes correlation matrices, performs Kaiser-Meyer-Olkin (KMO) and Bartlett's tests, determines the optimal number of principal components using multiple selection criteria, generates component loadings and scores, and produces publication-ready tables and graphical outputs for researchers and students. Methodological background is described in Shankar et al. (2024) <doi:10.1007/s12665-024-11985-5>.
License: GPL-3
Encoding: UTF-8
Imports: ggplot2, ggcorrplot, corrplot, psych, factoextra, stats, graphics, utils
NeedsCompilation: no
Config/roxygen2/version: 8.1.0
Packaged: 2026-08-21 14:17:55 UTC; JARVIS
Author: S. Vishnu Shankar [aut, cre], V. Lavanya [aut], Santosha Rathod [aut], Mrinmoy Ray [aut], Anil Kumar [aut], Balaji Kannan [aut]
Maintainer: S. Vishnu Shankar <S.vishnushankar55@gmail.com>
Repository: CRAN
Date/Publication: 2026-08-30 10:00:22 UTC

Principal Component Analysis with Automated Interpretation and Visualization

Description

Provides an automated workflow for Principal Component Analysis (PCA) that simplifies multivariate data analysis by performing essential preprocessing, statistical tests, component extraction, and visualization in a single function call. The package automatically standardizes variables, computes correlation matrices, performs Kaiser-Meyer-Olkin (KMO) and Bartlett's tests, determines the optimal number of principal components using multiple selection criteria, generates component loadings and scores, and produces publication-ready tables and graphical outputs for researchers and students.

Usage

EasyPCA(
  Data,
  scale = TRUE,
  components = "auto",
  cumulative = 75,
  rotation = c("varimax", "promax", "none"),
  verbose = TRUE,
  plots = interactive()
)

Arguments

Data

A numeric data frame or matrix containing the variables to be analyzed using Principal Component Analysis.

scale

Logical value indicating whether the variables should be standardized before PCA. The default is TRUE.

components

Number of principal components to retain. The default is "auto", which automatically determines the optimal number of components using Kaiser's criterion, Scree Plot, and cumulative percentage of explained variance. Alternatively, a positive integer may be supplied.

cumulative

Minimum cumulative percentage of explained variance required for component selection. The default is 75.

rotation

Character string specifying the rotation method used for interpreting principal components. Available options are "varimax", "promax", and "none".

verbose

Logical value. If TRUE, prints progress messages and intermediate results.

plots

Logical value. If TRUE, produces plots during the analysis. The default is interactive().

Details

The returned object stores the full PCA workflow output, including test results, eigen decomposition summaries, scores, loadings, and variable importance measures. The function also produces scree plots, correlation heatmaps, score plots, loading plots, biplots, and contribution charts when called.

Value

An object of class "EasyPCA" returned invisibly, containing:

References

Shankar, S. V., Kumaraperumal, R., Radha, M., Kannan, B., Patil, S. G., Vanitha, G., ... & Ananthakrishnan, S. (2024). Generation of digital soil mapping for Coimbatore districts using multinomial logistic regression approach. Environmental Earth Sciences, 83(24), 677. doi:10.1007/s12665-024-11985-5

Examples

data(USArrests)
Model <- EasyPCA(Data = USArrests)
Model


Plot EasyPCA Results

Description

Produces a scree plot for an EasyPCA object.

Usage

## S3 method for class 'EasyPCA'
plot(x, type = "scree", ...)

Arguments

x

An object of class "EasyPCA".

type

Type of plot. Currently only "scree" is supported.

...

Additional graphical arguments passed to plot.

Value

Invisibly returns the input object x, which is an object of class "EasyPCA". The function is primarily called for its graphical side effect of drawing a scree plot on the active graphics device.