pcaPlot {Harman} | R Documentation

## PCA plot for harman results

### Description

Generates a Principle Component plot for an instance of `harmanresults`.

### Usage

    pcaPlot(harmanresults, pc_x = 1, pc_y = 2, this = "corrected",
      colBy = "batch", pchBy = "expt", palette = "rainbow", legend = TRUE,
      col, pch, ...)

### 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.
`this` | string, legal values are `original` or `corrected`.
`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`.
`pchBy` | string, point-type by the experimental or batch variable; legal values are `expt` and `batch`. This parameter is overridden by `pch`.
`palette` | string, the function to call to create a vector of contiguous colours with the levels of factor in `colBy` steps.
`legend` | logical, whether to display a legend on the plot.
`col,` | colour vector for the points. This parameter overrides `colBy` and `palette`.
`pch,` | integer vector giving the point type. This parameter overrides `pchBy`.
`...` | further arguments passed to or from other methods.

### Details

If a vector of colours is supplied via the `col` argument, then a legend will not be drawn.

### Value

None

### See Also

`harmanresults` `plot.harmanresults`

### Examples

    library(HarmanData)
    data(OLF)
    expt <- olf.info$Treatment
    batch <- olf.info$Batch
    olf.harman <- harman(as.matrix(olf.data), expt, batch)
    pcaPlot(olf.harman)
    pcaPlot(olf.harman, colBy='expt')
    pcaPlot(olf.harman, pc_x=2, pc_y=3, this='original', pch=17)

[Package Harman version 1.14.0 Index]