| truncate.genpca | R Documentation |
Returns a new genpca object retaining only the first ncomp components.
All component-indexed slots (v, s, sdev, ov, ou, u, propv,
cumv) are sliced consistently; the preprocessing object and constraint
matrices are carried over unchanged.
## S3 method for class 'genpca'
truncate(x, ncomp)
x |
A |
ncomp |
Number of components to retain (a positive integer no larger
than |
A genpca object with ncomp components.
genpca(), reconstruct.genpca()
X <- matrix(rnorm(60), 15, 4)
fit <- genpca(X, ncomp = 4)
fit2 <- truncate(fit, 2)
multivarious::ncomp(fit2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.