addPheno,RnBSet-method {RnBeads} | R Documentation

## addPheno

### Description

Adds phenotypic or processing information to the sample annotation table of the given `RnBSet` object.

### Usage

    ## S4 method for signature 'RnBSet'
    addPheno(object, trait, header)

### Arguments

`object` | `RnBSet` of interest.
`trait` | Trait as a non-empty `vector` or `factor`. The length of this vector must be equal to the number of samples in `object`, the i-th element storing the value for the i-th sample. Note that names, if present, are ignored.
`header` | Trait name given as a one-element `character`. This is the heading to be used for the sample annotation table. This method fails if such a trait already exists; in other words, if `header %in% names(pheno(object))`.

### Value

The modified dataset as an object of type `RnBSet`.

### Author(s)

Fabian Mueller

### Examples

    library(RnBeads.hg19)
    data(small.example.object)
    logger.start(fname=NA)
    is.hiPSC <- pheno(rnb.set.example)[, "Sample_Group"]=="hiPSC"
    rnb.set.mod <- addPheno(rnb.set.example, is.hiPSC, "is_hiPSC")
    pheno(rnb.set.mod)

[Package RnBeads version 1.12.1 Index]