View source: R/transfer_wrappers.R
| transfer.cross_projector | R Documentation |
Provides a transfer method that accepts source/target arguments
used in the tests. The method forwards to multivarious's
transfer method which expects from/to.
## S3 method for class 'cross_projector'
transfer(x, new_data, from = NULL, to = NULL, opts = list(), ...)
x |
A cross_projector object. |
new_data |
New data to transfer. |
from |
Source space ("X" or "Y"). |
to |
Target space ("X" or "Y"). |
opts |
Options list passed to multivarious::transfer. |
... |
Additional arguments. Legacy parameters |
Matrix with transferred data.
# Generate sample data
set.seed(123)
n <- 50
X <- matrix(rnorm(n * 10), n, 10)
Y <- matrix(rnorm(n * 8), n, 8)
# Create a cross projector using rpls
fit <- rpls(X, Y, K = 2)
# Transfer new X data to Y space
new_X <- matrix(rnorm(10 * 10), 10, 10)
transferred <- transfer(fit, new_X, from = "X", to = "Y")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.