pcaPlot: Plot the first two principle components

Description Usage Arguments Value Examples

Description

Given a data.frame, plot the first two principle components and label them

Usage

1
2
pcaPlot(df, groups = NULL, useColLabels = TRUE, centerDf = TRUE,
  scaleDf = FALSE)

Arguments

df

a data.frame with columns referring to different experimental conditions

groups

group by which to color columns by

useColLabels

if true, print the column names on the plot

centerDf

center df in prcomp

scaleDf

scale df in prcomp

Value

a ggplot object

Examples

1
2
3
4
5
6
7
require(graphics)

head(USArrests)
pcaPlot(USArrests)
pcaPlot(USArrests[,c('Murder', 'Assault', 'Rape')])
pcaPlot(USArrests, c('crime', 'crime', 'pop', 'crime'))
pcaPlot(USArrests, c('crime', 'crime', 'pop', 'crime'), F)

pimentel/haRold documentation built on May 25, 2019, 7:12 a.m.