supervisedPCA: Supervised PCA plot

View source: R/utils.R

supervisedPCAR Documentation

Supervised PCA plot

Description

Performs supervised principle component analysis (PCA) after filtering dataset to help determine whether filtering has been useful for separating samples according to the outcome variable.

Usage

supervisedPCA(y, x, filterFUN = NULL, filter_options = NULL, plot = TRUE, ...)

Arguments

y

Response vector

x

Matrix of predictors

filterFUN

Filter function, e.g. ttest_filter or relieff_filter. Any function can be provided and is passed y and x. Must return a character vector with names of filtered predictors.

filter_options

List of additional arguments passed to the filter function specified by filterFUN.

plot

Logical whether to plot a ggplot2 object or return the PC scores

...

Optional arguments passed to princomp()

Value

If plot=TRUE returns a ggplot2 plot, otherwise returns the principle component scores.


nestedcv documentation built on Oct. 26, 2023, 5:08 p.m.