ggplot.well {twoddpcr} | R Documentation

## ggplot methods for the `ddpcrWell` and `ddpcrPlate` classes.

### Description

These functions work in the same way as the original `ggplot` method, but handles the coercion of the object into a data frame.

`ggplot.well` is a `ggplot` method for the `ddpcrWell` class.

`ggplot.multiwell` is a `ggplot` method for the `ddpcrPlate` class.

### Usage

    ggplot.well(
      data,
      mapping = aes_string(x = "Ch2.Amplitude", y = "Ch1.Amplitude", colour = cMethod),
      cMethod = NULL,
      ...,
      environment = parent.frame()
    )

    ## S4 method for signature 'ddpcrWell'
    ggplot.well(
      data,
      mapping = aes_string(x = "Ch2.Amplitude", y = "Ch1.Amplitude", colour = cMethod),
      cMethod = "None",
      ...,
      environment = parent.frame()
    )

    ggplot.plate(
      data,
      mapping = aes_string(x = "Ch2.Amplitude", y = "Ch1.Amplitude", colour = class),
      cMethod = "None",
      ...,
      environment = parent.frame()
    )

    ## S4 method for signature 'ddpcrPlate'
    ggplot.plate(
      data,
      mapping = aes_string(x = "Ch2.Amplitude", y = "Ch1.Amplitude", colour = cMethod),
      cMethod = "None",
      ...,
      environment = parent.frame()
    )

### Arguments

`data` | A `ddpcrWell` or `ddpcrPlate` object.
`mapping` | A list of aesthetic mappings to use for the plot. Defaults to `ggplot2::aes_string(x="Ch2.Amplitude", y="Ch1.Amplitude", colour=cMethod)`, where `cMethod` is taken from the parameter of the same name.
`cMethod` | The name or column number of the classification to use. This is renamed internally to "class" for use with `mapping`. Defaults to "None".
`...` | Other arguments passed onto `ggplot`.
`environment` | Where to look if a mapping variable is not defined. Defaults to `parent.frame()`, i.e. the environment in which `ggplot.well()` or `ggplot.multiwell()` is called.

### Value

A `ggplot` object using the slots in the given object.

### Author(s)

Anthony Chiu, anthony.chiu@cruk.manchester.ac.uk

### See Also

`dropletPlot` builds upon these `ggplot` methods to plot droplet amplitude plots with a colour-blind friendly palette.

The original `ggplot` method in the `ggplot2` package is used internally.

### Examples

    ## Plot the droplets in one well.
    library(ggplot2)
    aWell <- ddpcrWell(KRASdata[["E03"]])
    ggplot.well(aWell, cMethod="Cluster") + geom_point()

    ## Plot the droplets in all of the wells in a single plot.
    krasPlate <- ddpcrPlate(KRASdata)
    ggplot.plate(krasPlate, cMethod="Cluster") + geom_point()

[Package twoddpcr version 1.12.0 Index]