Learn R Programming

RnBeads (version 1.4.0)

addPheno,RnBSet-method: addPheno

Description

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

Usage

"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.

Examples

Run this code

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)

Run the code above in your browser using DataLab