plotPCA(object, groups = NULL, groupnames = NULL, addtext = NULL, x.coord = NULL, y.coord = NULL, screeplot = FALSE, squarepca = FALSE, pch = NULL, col = NULL, pcs = c(1, 2), legend = TRUE, main = "Principal Components Plot", plot3d = FALSE, outside = FALSE, ...)
ExpressionSet
, matrix
or prcomp
object.vector
delineating group membership for
samples. Default is NULL
, in which case default plotting symbols and
colors will be used.vector
describing the different groups.
Default is NULL
, in which case the sample names will be used.vector
of additional text to be placed
just above the plotting symbol for each sample. This is helpful if there are
a lot of samples for identifying e.g., outliers.screeplot
instead of a
PCA plot? Defaults to FALSE
.FALSE
.vector
indicating what plotting symbols to use.
Default is NULL
, in which case default plotting symbols will be used.
Note that this argument will override the 'groups' argument.vector
indicating what color(s) to
use for the plotting symbols. Default is NULL
in which case default
colors will be used. Note that this argument will override the 'groups'
argument.vector
of length two (or three if plot3d is
TRUE
), indicating which principal components to plot. Defaults to the
first two principal components.TRUE
.vector
for the plot title.TRUE
, then the PCA plot will be rendered in
3D using the rgl package. Defaults to FALSE
. Note that the pcs
argument should have a length of three in this case.TRUE
the legend will be placed outside the
plotting region, at the top right of the plot.plot
. See the help
page for plot
for further information.
library("affy")
data(sample.ExpressionSet)
plotPCA(sample.ExpressionSet, groups =
as.numeric(pData(sample.ExpressionSet)[,2]), groupnames =
levels(pData(sample.ExpressionSet)[,2]))
Run the code above in your browser using DataLab