Description Usage Arguments Value Author(s) Examples
The expandFeatureVars
and mergeFeatureVars
respectively expand
and merge groups of feature variables. Using these functions, a
set of columns in a feature data can be merged into a single new
data.frame-column variables and a data.frame-column can be
expanded into single feature columns. The original feature
variables are removed.
1 2 3 | expandFeatureVars(x, fcol, prefix)
mergeFeatureVars(x, fcol, fcol2)
|
x |
An object of class |
fcol |
A |
prefix |
A |
fcol2 |
A |
An MSnSet
for expanded (merged) feature variables.
Laurent Gatto
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | library("pRolocdata")
data(hyperLOPIT2015)
fvarLabels(hyperLOPIT2015)
## Let's merge all svm prediction feature variables
(k <- grep("^svm", fvarLabels(hyperLOPIT2015), value = TRUE))
hl <- mergeFeatureVars(hyperLOPIT2015, fcol = k, fcol2 = "SVM")
fvarLabels(hl)
head(fData(hl)$SVM)
## Let's expand the new SVM into individual columns
hl2 <- expandFeatureVars(hl, "SVM")
fvarLabels(hl2)
## We can set the prefix manually
hl2 <- expandFeatureVars(hl, "SVM", prefix = "Expanded")
fvarLabels(hl2)
## If we don't want any prefix
hl2 <- expandFeatureVars(hl, "SVM", prefix = NULL)
fvarLabels(hl2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.