R Observatory
Search
install.packages("nsprcomp")
CRAN 30-day downloads, method
413−17.2% down on the 30 days before, the worse direction
Test coverage, method
92%of lines run by tests

Two methods for performing a constrained principal component analysis (PCA), where non-negativity and/or sparsity constraints are enforced on the principal axes (PAs). The function 'nsprcomp' computes one principal component (PC) after the other.

Full description

Two methods for performing a constrained principal component analysis (PCA), where non-negativity and/or sparsity constraints are enforced on the principal axes (PAs). The function 'nsprcomp' computes one principal component (PC) after the other. Each PA is optimized such that the corresponding PC has maximum additional variance not explained by the previous components. In contrast, the function 'nscumcomp' jointly computes all PCs such that the cumulative variance is maximal. Both functions have the same interface as the 'prcomp' function from the 'stats' package (plus some extra parameters), and both return the result of the analysis as an object of class 'nsprcomp', which inherits from 'prcomp'. See <https://sigg-iten.ch/learningbits/2013/05/27/nsprcomp-is-on-cran/> and Sigg et al. (2008) <doi:10.1145/1390156.1390277> for more details.

Maintainer
Christian Sigg
Licence
GPL (>= 2)
Latest release
5 Jun 2018
First release
16 Apr 2013

Compare with another package

More details
Releases
6
Needs compilation
No
Needs R
>= 3.4.0
RoxygenNote
6.0.1
Task views (1)
Subjects (1) Method, Subjects
Cite

Package

Run in R for the authors' entry:

citation("nsprcomp")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.1145/1390156.1390277.

R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA
Balamuta, J. J. (2026). R Observatory: Metrics for nsprcomp version 0.5.1-2 [Data set]. HJJB, LLC. Data release v2026-10-28. https://doi.org/10.5281/zenodo.21843040
About

From data release v2026-10-28, which the citation names so these numbers can be found later.

All 13 check platforms pass.

  • r-devel-linux-x86_64-debian-clang

    The unreleased R on Linux, x86_64, debian-clang

    OK

    Version checked
    0.5.1-2
    Time taken
    34 s
  • r-devel-linux-x86_64-debian-gcc

    The unreleased R on Linux, x86_64, debian-gcc

    OK

    Version checked
    0.5.1-2
    Time taken
    27 s
  • r-devel-linux-x86_64-fedora-clang

    The unreleased R on Linux, x86_64, fedora-clang

    OK

    Version checked
    0.5.1-2
    Time taken
    26 s
  • r-devel-linux-x86_64-fedora-gcc

    The unreleased R on Linux, x86_64, fedora-gcc

    OK

    Version checked
    0.5.1-2
    Time taken
    22 s
  • r-devel-windows-x86_64

    The unreleased R on Windows, x86_64

    OK

    Version checked
    0.5.1-2
    Time taken
    62 s
  • r-oldrel-macos-arm64

    The previous release of R on macOS, arm64

    OK

    Version checked
    0.5.1-2
  • r-oldrel-macos-x86_64

    The previous release of R on macOS, x86_64

    OK

    Version checked
    0.5.1-2
    Time taken
    34 s
  • r-oldrel-windows-x86_64

    The previous release of R on Windows, x86_64

    OK

    Version checked
    0.5.1-2
    Time taken
    62 s
  • r-patched-linux-x86_64

    The patched release of R on Linux, x86_64

    OK

    Version checked
    0.5.1-2
    Time taken
    32 s
  • r-release-linux-x86_64

    The current release of R on Linux, x86_64

    OK

    Version checked
    0.5.1-2
    Time taken
    32 s
  • r-release-macos-arm64

    The current release of R on macOS, arm64

    OK

    Version checked
    0.5.1-2
    Time taken
    12 s
  • r-release-macos-x86_64

    The current release of R on macOS, x86_64

    OK

    Version checked
    0.5.1-2
    Time taken
    38 s
  • r-release-windows-x86_64

    The current release of R on Windows, x86_64

    OK

    Version checked
    0.5.1-2
    Time taken
    62 s
  • 13 OK

Over time

No change since 5 Aug 2026

As a list (3)
ChangedWorst statusOKNotesWarningsErrors
5 Aug 2026OK13000
1 Aug 2026Note12100
10 Mar 2026OK14000

Since March 2026

Check results on CRAN

Total downloads in the last 30 days
545−6.5% down on the 30 days before, the worse directionIt is the sum of 5 channels: CRAN, r2u, autoCRAN, conda-forge and c2d4u.

CRAN rank

8,053 of 26,530

CRAN

413 downloads in the last 30 days

Rank
8,053 of 26,530
Change
−17.2% down on the 30 days before, the worse direction

It is in the total. Take it out

r2u

13 downloads in the last 30 days

Rank
5,800 of 30,526
Change
no change on the 30 days before

It is in the total. Take it out

autoCRAN

1 downloads in the last 30 days

Rank
25,688 of 29,212
Change
−90.9% down on the 30 days before, the worse direction

It is in the total. Take it out

conda-forge

116 downloads in the last 30 days

Rank
3,200 of 3,828
Change
+132% up on the 30 days before, the better direction

It is in the total. Take it out

c2d4u, no longer updated

2 downloads in the last 30 days

Rank
4,900 of 7,575
Change
−80% down on the 30 days before, the worse direction

It is in the total. Take it out

Over time

Compare downloads

Needs
1
Dependent packages
1
Suggested by
0
Needs (1)
  • stats
Installing it adds
0 packages, 0 KB of source
Of those, need compilation
0
Optional extras (3)
Dependent packages (1)
PackageTitleDownloads in 30 days
GWnnegPCAGeographically Weighted Non-Negative Principal Components Analysis240
Functions
13
Public exports
5
Lines of R code
901
Median complexity
5
Functions (13)
Size and composition

Lines by kind (2,057)

KindLinesShare
R code90144%
Tests67233%
Documentation48424%

Lines by language

LanguageLinesShare
R1,57377%
Rd48424%

Languages are counted from file extensions.

Files
31
R functions
13
Object systems
S3: 4 methods
Complexity
Median
5
Mean
6.62
Highest
25
Median lines per function
28
About complexity

Cyclomatic complexity counts the independent paths through a function: 1 is a straight line, higher is harder to test. R functions only.

Call graph figures
R functions
13
Calls
10
Unconnected
3
Groups
1
Growth (6 releases)
Total lines by release
973 on 7 Apr 20132,057 on 5 Jun 2018
Release changes

The tests ran and coverage was measured.

Lines run by tests
92.2%
Expressions run by tests
93.4%
Test cases
40
Exports named in tests
100%
Coverage by file (6)
Coverage run
Lines counted
345
Lines the tests ran
318
Tests passed
Yes
Measured with
covr 3.6.5 on R 4.6.1
Test suite
Has tests
Yes
Test frameworks
testthat
Test cases
40
Lines of tests
672
Test lines per line of code
0.75
Exports documented
100%
Arguments documented
73.3%
Return value documented
60%
Help pages with examples
40%
Examples run in checks
100%
Other documentation
README
Yes, 846 words
Release notes file
No
Help pages
5
Lines of documentation
484

chrsigg / nsprcomp on github.com

Stars
9
Forks
6
Open issues
0
Last commit
5 Jun 2018
Activity
Commits
36
Open pull requests
0
Tagged releases
0
Latest tagged release
–
Issues closed in
2 days (median)
Pull requests closed in
–
Pull requests merged
–
Created
27 Feb 2013
Licence file reads as
–
R releases
  • On CRAN
  • Release
VersionReleasedR
0.5.1-2 current5 Jun 20183.5.0
0.517 Jul 20143.1.1
0.4.122 Sep 20133.0.1
0.419 Sep 20133.0.1
0.329 May 20133.0.1
0.216 Apr 20133.0.0