Learn R Programming

PCADSC (version 0.8.0)

doChroma: Compute chroma information

Description

Computes the information that is needed in order to make a chromaPlot from a PCADSC or pcaRes object. Typically, this function is called on a partial PCADSC object in order to add chromaInfo (see examples).

Usage

doChroma(x)

Arguments

x
Either a PCADSC or a pcaRes object.

See Also

chromaPlot, PCADSC

Examples

Run this code
#load iris data
data(iris)

#Define grouping variable, grouping the observations by whether their species is
#Setosa or not
iris$group <- "setosa"
iris$group[iris$Species != "setosa"] <- "non-setosa"
iris$Species <- NULL

## Not run: ------------------------------------
# #make a partial PCADSC object, splitting the data by "group"
# irisPCADSC <- PCADSC(iris, "group", doChroma = FALSE)
# 
# #No chromaInfo available
# irisPCADSC$chromaInfo
# 
# #Add and show chromaInfo
# irisPCADSC <- doChroma(irisPCADSC)
# irisPCADSC$chromaInfo
## ---------------------------------------------

#Make a partial PCADSC object and only add chroma information for a
#faster runtime
irisPCADSC_fast <- PCADSC(iris, "group", doAngle = FALSE,
  doChroma = FALSE, doCE = FALSE)
irisPCADSC_fast <- doChroma(irisPCADSC_fast)
irisPCADSC_fast$chromaInfo

Run the code above in your browser using DataLab