Package: spca 1.1.5

spca: Least Squares Sparse Principal Components Analysis

Implements least-squares sparse principal component analysis with cardinality constraints. The package has an efficient C++ backend and provides functions for fitting, summarizing, comparing, and visualizing sparse principal component models. The approach follows Merola (2015) <doi:10.1111/anzs.12128> and Merola and Chen (2019) <doi:10.1016/j.jmva.2019.04.001>.

Authors:Giovanni Maria Merola [aut, cre]

spca_1.1.5.tar.gz
spca_1.1.5.zip(r-4.7-x86_64)spca_1.1.5.zip(r-4.7-arm64)spca_1.1.5.zip(r-4.6-x86_64)spca_1.1.5.zip(r-4.6-arm64)spca_1.1.5.zip(r-4.5-x86_64)
spca_1.1.5.tgz(r-4.6-x86_64)spca_1.1.5.tgz(r-4.6-arm64)spca_1.1.5.tgz(r-4.5-x86_64)spca_1.1.5.tgz(r-4.5-arm64)
spca_1.1.5.tar.gz(r-4.7-arm64)spca_1.1.5.tar.gz(r-4.7-x86_64)spca_1.1.5.tar.gz(r-4.6-arm64)spca_1.1.5.tar.gz(r-4.6-x86_64)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
spca/json (API)

# Install 'spca' in R:
install.packages('spca', repos = c('https://merolagio.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/merolagio/spca/issues

Uses libs:
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

Conda:

cpp

5.34 score 1 stars 13 scripts 358 downloads 17 exports 20 dependencies

Last updated from:b4f4d4f3b2. Checks:14 OK, 1 FAIL. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK223
linux-devel-x86_64OK230
source / vignettesOK367
linux-release-arm64OK181
linux-release-x86_64OK256
macos-release-arm64OK338
macos-release-x86_64OK631
macos-oldrel-arm64OK245
macos-oldrel-x86_64OK443
windows-devel-arm64OK503
windows-devel-x86_64OK326
windows-release-arm64OK433
windows-release-x86_64OK253
windows-oldrel-x86_64OK254
wasm-releaseFAIL113

Exports:aggregate_by_groupchange_loadings_sign_spcachange_signchange_weights_sign_spcacompare_spcais.pcais.spcamp_qqplotnew_spcapcascree_plotshow_contributions_spcashow_correlationsshow_weightsspcaspca_screeplotwachter_qqplot

Dependencies:clicpp11farverggplot2gluegtableisobandlabelinglifecycleR6RColorBrewerRcppRcppEigenrlangRMTstatS7scalesvctrsviridisLitewithr

Introduction to the spca package
Installation | Usage | Example | Load data | Preliminary PCA | Compute the sparse weights | Inspect spca results | Variable groups | Comparison of two or more spca solutions | Practical recommendations

Last update: 2026-09-23
Started: 2026-05-30

spca extended vignette
title: "spca Extended Vignette"author: "Giovanni Maria Merola"date: "r Sys.Date()"output: rmarkdown::html_vignettevignette: >%\VignetteIndexEntry{spca extended vignette}%\VignetteEngine{knitr::rmarkdown}%\VignetteEncoding{UTF-8}%\VignetteDepends{spca}knit: (function(input, ...) rmarkdown::render(input, output_dir = dirname(normalizePath(input)), ...)) | Introduction | LS-SPCA in brief | The spca package | A typical SPCA workflow using spca | PCA | SPCA | summary() | Comparison of SPCA with PCA | Analysis of the sparse solutions | print() | plot() | Comparison of two LS-SPCA solutions | Fixed indices | Create an spca object | Practical recommendations | Application to larger datasets | MSSCQ data | Isolet data | Colon data | Comparison of LS-SPCA variants | Computation methods | Variable selection methods | alpha | Comparison with conventional SPCA | Tall matrices | Fat matrices | References

Last update: 2026-09-23
Started: 2026-08-24