Compatibility wrapper for multivarious::transfer
Source:R/transfer_wrappers.R
transfer.cross_projector.RdProvides a transfer method that accepts `source`/`target` arguments used in the tests. The method forwards to `multivarious`'s transfer method which expects `from`/`to`.
Arguments
- 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 `source` and `target` are accepted here for backwards compatibility but are deprecated; use `from` and `to` instead.
Examples
# \donttest{
# 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")
# }