wellClassification {twoddpcr} | R Documentation

## Retrieve a classification vector.

### Description

Retrieve the classification from a `ddpcrWell` object.

### Usage

    wellClassification(theObject, cMethod = NULL, withAmplitudes = FALSE)

    ## S4 method for signature 'ddpcrWell'
    wellClassification(theObject, cMethod = NULL,
      withAmplitudes = FALSE)

    wellClassification(theObject, cMethod) <- value

    ## S4 replacement method for signature 'ddpcrWell'
    wellClassification(theObject, cMethod) <- value

### Arguments

`theObject` | A `ddpcrWell` object.
`cMethod` | The names (or column numbers) of the classification to retrieve. If `NULL`, then all of the classifications are obtained. Defaults to `NULL` when retrieving. When setting a classification, this cannot be `NULL`.
`withAmplitudes` | Logical value. If `TRUE`, returns a data frame with the droplet amplitudes and corresponding classifications. If `FALSE`, returns the classification vector only. Defaults to `FALSE`.
`value` | A factor with the same length as the number of droplets in `theObject`, with levels in `ddpcr$classesRain`.

### Value

A factor or data frame corresponding to the requested classification(s).

### Author(s)

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

### See Also

`wellClassificationMethod` for the name of the classification method.

### Examples

    ## Take some droplets with a given classification.
    amplitudes <- KRASdata[["E03"]][, c("Ch1.Amplitude", "Ch2.Amplitude")]

    ## Create a ddpcrWell object with the amplitudes only.
    aWell <- ddpcrWell(well=amplitudes)

    ## This has no classification yet.
    head(wellClassification(aWell))

    ## We check the classification now, showing the amplitudes as well.
    head(wellClassification(aWell, withAmplitudes=TRUE))

    ## Now set a sample classification.
    wellClassification(aWell, cMethod="Sample") <-
      rep(c("NN", "NP", "PN", "PP"), numDroplets(aWell) / 4)
    head(wellClassification(aWell, withAmplitudes=TRUE))

[Package twoddpcr version 1.6.0 Index]