Learn R Programming

XGR (version 1.1.4)

xRegress: Function to regress data according to principle components (PCs)

Description

xRegress is supposed to regress data according to principle components (PCs).

Usage

xRegress(data, center = TRUE, scale = TRUE, which.PCs = NULL)

Arguments

data

a data matrix/frame with, for exampe, genes in rows and samples in columns

center

logical to indicate whether the input data columns should be shifted to be zero centered when calculating PCs

scale

logical to indicate whether the input data columns should have unit variance when calculating PCs

which.PCs

a vector specifying which PCs are used for being regressed out. If NULL (by default), no gression is done

Value

a list with three componets:

  • regressed: the regressed data with the same dimension as the input data

  • PCs: a data matrix of PCs X samples

  • Ss: a vector storing the square roots of the eigenvalues

See Also

xRegress

Examples

Run this code
# NOT RUN {
# Load the library
library(XGR)
# }
# NOT RUN {
# }
# NOT RUN {
data(Fang)
ls_res <- xRegress(Fang, which.PCs=1)
gp <- xHeatmap(ls_res$PCs)
gp
# }

Run the code above in your browser using DataLab