Learn R Programming

multivarious (version 0.2.0)

ncomp: Get the number of components

Description

This function returns the total number of components in the fitted model.

Usage

ncomp(x)

Value

The number of components in the fitted model.

Arguments

x

A fitted model object.

Examples

Run this code
# Example using the svd_wrapper function
data(iris)
X <- iris[, 1:4]
fit <- svd_wrapper(X, ncomp = 3, preproc = center(), method = "base")
ncomp(fit) # Should return 3

Run the code above in your browser using DataLab