longForm,QFeatures-method | R Documentation |
The longForm()
method transform a QFeatures or SummarizedExperiment
instance into a long tidy DataFrame that contains the assay data, where
each quantitative value is reported on a separate line. colData
and
rowData
varibales can also be added. This function is an extension of the
longForm()
method in the MultiAssayExperiment::MultiAssayExperiment.
Note that the previous longFormat
implementation is not defunct.
## S4 method for signature 'QFeatures'
longForm(object, colvars = NULL, rowvars = NULL, i = 1L)
## S4 method for signature 'SummarizedExperiment'
longForm(object, colvars = NULL, rowvars = NULL, i = seq_along(assays(object)))
object |
An instance of class QFeatures or SummarizedExperiment. |
colvars |
A |
rowvars |
A |
i |
When |
A DataFrame
instance.
data(feat2)
longForm(feat2)
## add a colData variable and use it in longFrom
colData(feat2)$colvar <- paste0("Var", 1:12)
colData(feat2)
longForm(feat2, colvars = "colvar")
## use a rowData variable in longFrom
rowDataNames(feat2)
longForm(feat2, rowvar = "Prot")
## use both col/rowData
longForm(feat2, colvar = "colvar", rowvar = "Prot")
## also works on a single SE
se <- getWithColData(feat2, 1)
longForm(se)
longForm(se, colvar = "colvar")
longForm(se, rowvar = "Prot")
longForm(se, colvar = "colvar", rowvar = "Prot")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.