Learn R Programming

ribiosPlot (version 1.3.0)

expVarLabel.PCAScoreMatrix: Labels of principal components from PCAScoreMatrix

Description

Labels of principal components from PCAScoreMatrix

Usage

# S3 method for PCAScoreMatrix
expVarLabel(x, choices, compact = FALSE)

Value

A character string vector of the same length as choices (or the same length as the column count of the PCAScoreMatrix), which are the labels of the PCs

Arguments

x

A PCAScoreMatrix object

choices

Either a logical/integer vector to indicate which PCs to be returned, or NULL or missing, in which case all PCs are returned

compact

Logical, either a compact label is returned, see examples.

Examples

Run this code

pcaMat <- PCAScoreMatrix(matrix(rnorm(15),ncol=3), c(0.25, 0.15, 0.1))
expVarLabel(pcaMat)
expVarLabel(pcaMat, choices=1:2)
expVarLabel(pcaMat, choices=1:2, compact=TRUE)
expVarLabel(pcaMat, choices=c(1,3), compact=TRUE)

Run the code above in your browser using DataLab