partial_projector | R Documentation |
Create a new projector instance restricted to a subset of input columns. This function allows for the generation of a new projection object that focuses only on the specified columns, enabling the projection of data using a limited set of variables.
partial_projector(x, colind, ...)
x |
The original |
colind |
A numeric vector of column indices to select in the projection matrix. These indices correspond to the variables used for the partial projector |
... |
Additional arguments passed to the underlying |
A new projector
instance, with the same class as the original object, that is restricted to the specified subset of input columns
bi_projector
for an example of a class that implements a partial_projector
method
# Example with the bi_projector class
X <- matrix(rnorm(10*20), 10, 20)
svdfit <- svd(X)
p <- bi_projector(svdfit$v, s = svdfit$u %*% diag(svdfit$d), sdev=svdfit$d)
# Create a partial projector using only the first 10 variables
colind <- 1:10
partial_p <- partial_projector(p, colind)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.