Learn R Programming

inDAGO (version 1.0.0)

pcainfo: pcainfo

Description

Perform Principal Component Analysis (PCA) on log-expression data.

Usage

pcainfo(logcounts, center, scale)

Value

An object of class "prcomp " containing the PCA results, including loadings, scores, and explained variance.

Arguments

logcounts

Numeric matrix. Log-CPM values (genes × samples), e.g., from edgeR::cpm..

center

Logical. If TRUE, center variables by subtracting the mean (default: TRUE).

scale

Logical. If TRUE, scale variables to unit variance (default: FALSE).

Details

This function transposes a log-count matrix (samples as columns, genes as rows) and runs PCA using "stats::prcomp() ", with options to center and scale variables.