xRegress | R Documentation

## 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

### Note

none

### See Also

`xRegress`

### Examples

    ## Not run:
    # Load the library
    library(XGR)

    ## End(Not run)

    ## Not run:
    data(Fang)
    ls_res <- xRegress(Fang, which.PCs=1)
    gp <- xHeatmap(ls_res$PCs)
    gp

    ## End(Not run)