transform {rchemo}R Documentation

Generic transform function

Description

Transformation of the X-data by a fitted model.

Usage


transform(object, X, ...)

Arguments

object

A fitted model, output of a call to a fitting function.

X

New X-data to consider.

...

Optional arguments.

Value

the transformed X-data

Examples


## EXAMPLE 1

n <- 6 ; p <- 4
X <- matrix(rnorm(n * p), ncol = p)
y <- rnorm(n)

fm <- pcaeigen(X, nlv = 3)

fm$T
transform(fm, X[1:2, ], nlv = 2)

## EXAMPLE 2

n <- 6 ; p <- 4
X <- matrix(rnorm(n * p), ncol = p)
y <- rnorm(n)

fm <- plskern(X, y, nlv = 3)
fm$T
transform(fm, X[1:2, ], nlv = 2)


[Package rchemo version 0.1-1 Index]