Learn R Programming

Harman (version 1.0.2)

arrowPlot: PCA before and after arrow plot for harman results

Description

Generates an arrow plot for an instance of harmanresults. The tail of the arrow is the starting point (original) in principle coordinates, while the arrow head is the new point (corrected) in principle coordinates. It can be observed that on principle components that have undergone correction (codeharmanresults$stats$correction < 1.0), the samples within a batch will be coordinately moved towards 0 on that priciple component.

Usage

arrowPlot(harmanresults, pc_x = 1, pc_y = 2, colBy = "batch", palette = "rainbow", col, length = 0.1, legend = TRUE, ...)

Arguments

harmanresults
an instance of harmanresults.
pc_x
integer, principle component for the plot x dimension.
pc_y
integer, principle component for the plot y dimension.
colBy
string, colour the points by the experimental or batch variable; legal values are expt and batch. The palette function specified in palette is used. This parameter is overridden by col.
palette
string, the function to call to create a vector of contiguous colours with the levels of factor in colBy steps.
col,
colour vector for the points. This parameter overrides palette.
length
length of the arrow heads, default is 0.1.
legend
logical, whether to display a legend on the plot
...
further arguments passed to or from other methods.

Value

None

Details

Generates a Principle Component plot for an instance of harmanresults. If a vector of colours is supplied via the col argument, then a legend will not be drawn.

See Also

harmanresults plot.harmanresults

Examples

Run this code
library(HarmanData)
data(OLF)
expt <- olf.info$Treatment
batch <- olf.info$Batch
olf.harman <- harman(olf.data, expt, batch)
arrowPlot(olf.harman, pc_x=2, pc_y=3, length=0.2)

Run the code above in your browser using DataLab