| AnnotatedDataFrame {Biobase} | R Documentation |
An AnnotatedDataFrame consists of two parts. There is a collection
of samples and the values of variables measured on those
samples. There is also a description of each variable measured. The
components of an AnnotatedDataFrame can be accessed with
pData and varMetadata.
Versioned
new("AnnotatedDataFrame")
new("AnnotatedDataFrame", data=data.frame(),
varMetadata=data.frame(), dimLabels=c("rowNames", "columnNames"))
AnnotatedDataFrame instances are created using new. The
initialize method takes up to three arguments, data,
varMetadata, and dimLabels. data is a
data.frame of the samples (rows) and measured variables
(columns). varMetadata is a data.frame with the number
of rows equal to the number of columns of the data argument.
varMetadata describes aspects of each measured
variable. dimLabels provides aesthetic control for labeling rows
and columns in the show method. varMetadata and
dimLabels can be missing.
as(data.frame, "AnnotatedDataFrame") coerces a data.frame to an
AnnotatedDataFrame.
annotatedDataFrameFrom may be a convenient way to create
an AnnotatedDataFrame from AssayData-class.
Class-specific slots:
data:data.frame containing samples (rows)
and measured variables (columns).varMetadata:data.frame with number of rows
equal number of columns in data, and at least one column,
named labelDescription, containing a textual description
of each variable.Class-specific methods.
combine(<AnnotatedDataFrame>,
<AnnotatedDataFrame>:AnnotatedDataFrame to a second
AnnotatedDataFrame, returning the result as an
AnnotatedDataFrame. Row (sample) names in each argument
must be unique. Variable names present in both arguments occupy a
single column in the resulting AnnotatedDataFrame. Variable
names unique to either argument create columns with values
assigned for those samples where the variable is
present. varMetadata in the returned
AnnotatedDataFrame is updated to reflect the combination.pData(<AnnotatedDataFrame>),
pData(<AnnotatedDataFrame>)<-<data.frame>:AnnotatedDataFramevarMetadata(<AnnotatedDataFrame>),
varMetadata(<AnnotatedDataFrame>)<-<data.frame>:AnnotatedDataFramefeatureNames(<AnnotatedDataFrame>),
featureNames(<AnnotatedDataFrame>)<-<ANY>:AnnotatedDataFrame; a
synonym for sampleNames.sampleNames(<AnnotatedDataFrame>),
sampleNames(<AnnotatedDataFrame>)<-<ANY>:AnnotatedDataFramevarLabels(<AnnotatedDataFrame>),
varLabels(<AnnotatedDataFrame>)<-<data.frame>:AnnotatedDataFramedimLabels(<AnnotatedDataFrame>)AnnotatedDataFrame, e.g., ‘rowNames’,
‘columnNames’.Standard generic methods:
initialize(<AnnotatedDataFrame>):new; not to be called directly by the user.as(<data.frame>, "AnnotatedDataFrame"):data.frame to an AnnotatedDataFrame.as(<phenoData>,<AnnotatedDataFrame>):phenoData-class objects to
AnnotatedDataFrame, issuing warnings as appropriate.validObject(<AnnotatedDataFrame>):data and
varMetadata elementsupdateObject(object, ..., verbose=FALSE)updateObjectisCurrent(object)isCurrentisVersioned(object)isVersionedshow(<AnnotatedDataFrame>)[<sample>,<variable>:AnnotatedDataFrame, i.e., including relevant
metadata. Unlike a data.frame, setting drop=TRUE
generates an error. [[<sample>, $<sample>:[[<-<new_sample>, $<-<new_sample>:dim(<AnnotatedDataFrame>),
ncol(<AnnotatedDataFrame>):dim) and variables (ncol) in the
argument.V.J. Carey, after initial design by R. Gentleman
eSet, ExpressionSet,
read.AnnotatedDataFrame
df <- data.frame(x=1:6,
y=rep(c("Low", "High"),3),
z=I(LETTERS[1:6]),
row.names=paste("Sample", 1:6, sep="_"))
metaData <-
data.frame(labelDescription=c(
"Numbers",
"Factor levels",
"Characters"))
new("AnnotatedDataFrame")
new("AnnotatedDataFrame", data=df)
new("AnnotatedDataFrame",
data=df, varMetadata=metaData)
as(df, "AnnotatedDataFrame")
obj <- new("AnnotatedDataFrame")
pData(obj) <- df
varMetadata(obj) <- metaData
validObject(obj)