Skip to content

pcreg

Advanced Methods for Principal Component Analysis and Principal Component Regression

v0.1.1 · May 31, 2026 · GPL-3

Description

Provides a unified framework for principal component analysis (PCA) and principal component regression (PCR), including standard PCA, sparse PCA, robust PCA, and supervised PCA. The package supports automatic selection of the number of components using cumulative variance and elbow methods and integrates PCA with regression modelling through PCR models. It includes tools for PCA suitability assessment using Bartlett's test of sphericity and the Kaiser-Meyer-Olkin (KMO) measure. Visualisation utilities such as scree plots and biplots are provided for interpretation. The methods are designed to handle multicollinearity, outliers, and high-dimensional data, making them suitable for applied statistical modelling and data analysis. The methodology is based on established approaches described in Jolliffe (2002) <doi:10.1007/b98835>, Zou et al. (2006) <doi:10.1111/j.1467-9868.2005.00503.x>, and Hubert et al. (2005) <doi:10.1198/004017004000000563>.

Downloads

CRAN

24.7K

Last 30 days

721st

31.3K

Last 90 days

31.3K

Last year

Trend: +274.9% (30d vs prior 30d)

autoCRAN

3

Last 7 days

10

Last 30 days

1

All-time

autoCRAN-only: this name is served only by autoCRAN, so the count is exact.

CRAN Check Status

13 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 OK

Check History

OK 11 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE Jun 1, 2026
ERROR 6 OK · 0 NOTE · 0 WARNING · 2 ERROR · 0 FAILURE May 30, 2026
ERROR r-release-macos-arm64

examples

Running examples in ‘pcreg-Ex.R’ failed
The error most likely occurred in:

> ### Name: robust_pcreg
> ### Title: Robust Principal Component Regression (Robust PCR)
> ### Aliases: robust_pcreg
> 
> ### ** Examples
> 
> data(mtcars)
> Result <- robust
...[truncated]...
 of these observations and
coefficients a_i from the vector a <- c(-0.3333333, 0, 0, 0, 0, 0,
-0.6666667, -0.6666667, 0, 0)
Error in eigen(mcd$cov, symmetric = TRUE) : 
  infinite or missing values in 'x'
Calls: robust_pcreg -> eigen
Execution halted
ERROR r-oldrel-macos-arm64

examples

Running examples in ‘pcreg-Ex.R’ failed
The error most likely occurred in:

> ### Name: robust_pcreg
> ### Title: Robust Principal Component Regression (Robust PCR)
> ### Aliases: robust_pcreg
> 
> ### ** Examples
> 
> data(mtcars)
> Result <- robust
...[truncated]...
 of these observations and
coefficients a_i from the vector a <- c(-0.3333333, 0, 0, 0, 0, 0,
-0.6666667, -0.6666667, 0, 0)
Error in eigen(mcd$cov, symmetric = TRUE) : 
  infinite or missing values in 'x'
Calls: robust_pcreg -> eigen
Execution halted

Code

Structure

Lines of code

3,173

Files

19

Compiled share

0%

Has compiled src

No

Language breakdown

R 2,914 (91.8%)Docs 259 (8.2%)

API

Exported functions

8

Internal functions

1

Recent export changes

v0.1.0+8 pca, pcreg, robust_pca +5 more

Testing & CI

Has tests

No

Test-to-code ratio

0.00

testthat edition

3

CI present

No

CI type

[]

PR gated

No

Docs

Return-value doc rate

100%

\dontrun example ratio

0%

Roxygen coverage

100%

Has pkgdown

No

NEWS present

No

Health & Security signals

Informational signals; not verdicts.

on.exit coverage

Unsafe pattern score

0

Dep constraint coverage

0%

Secret pattern count

0

Bundled 3rd-party code

2 items

Portability & License

Min R version

System requirements

C++ standard

License

GPL-3

License flags

SPDX valid, OSI approved

History

Versions

2

First release

2026-05-29

Latest release

2026-05-31

Avg cadence

2 days

Cold removal rate

Dep drift

0

LOC over versions

v0.1.0: 3,125 LOCv0.1.1: 3,173 LOC

Per-file churn detail lives in the source pipeline: https://github.com/r-observatory/cran-code-metrics.

Dependency Network

Dependencies Reverse dependencies ggplot2 ggrepel gridExtra scales psych elasticnet robustbase pcreg

Version History

2 tracked
updated 0.1.1 ← 0.1.0 diff May 31, 2026
new 0.1.0 May 29, 2026