pcapack is a high-performance C library with R bindings that can be used to quickly compute principal components, including truncated methods.
Note that the package is currently under development, and is not particularly stable.
Covariance:
test replications elapsed relative
2 pcapack 10 0.182 1.000
1 R 10 3.444 18.923
PCA:
test replications elapsed relative
1 pcapack 10 2.267 1.000
2 R 10 3.350 1.478
SVD:
test replications elapsed relative
1 pcapack 10 1.422 1.000
2 R 10 1.725 1.213
Centering and Scaling:
### center=TRUE, scale=FALSE
test replications elapsed relative
2 pcapack 10 0.236 1.000
1 R 10 2.381 10.089
### center=FALSE, scale=TRUE
test replications elapsed relative
2 pcapack 10 0.277 1.000
1 R 10 5.207 18.798
### center=TRUE, scale=TRUE
test replications elapsed relative
2 pcapack 10 0.476 1.000
1 R 10 7.719 16.216
You can find the source for these benchmarks in the inst/benchmarks/
tree.
All tests performed using:
To install, you will need:
Both the R package and the standalone library require cmake.
To install the R package, simply execute:
library(devtools)
install_github("wrahtematics/RNACI") ### dependency
install_github("wrathematics/pcapack")
To build just the shared library, in your terminal, execute make
in
pcapack/src/pcapack/
. A static and dynamic library will be placed
in the pcapack/src/pcapack/build
tree.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.