Join a new data frame of information to feature data of a MetaboSet object. The data frame needs to have a column "Feature_ID". This function is usually used internally by some of the functions in the package, but can be useful.
Arguments
- object
a
MetaboSet
object- dframe
a data frame with the new information
Examples
data(example_set)
ex_set <- as(example_set, "MetaboSet")
#> INFO [2025-06-23 22:36:42]
#> Checking feature information
#> INFO [2025-06-23 22:36:42] Checking that feature IDs are unique and not storedas numbers
#> INFO [2025-06-23 22:36:42] Checking that feature data includes a 'Split' column
#> INFO [2025-06-23 22:36:42] Checking that feature data includes a 'Flag' column
#> INFO [2025-06-23 22:36:42] Checking that feature abundances only contain numeric values
#> INFO [2025-06-23 22:36:42] Setting row and column names of exprs based on feature and pheno data
new_info <- data.frame(
Feature_ID = featureNames(ex_set),
Feature_number = seq_len(nrow(ex_set))
)
with_new_info <- join_fData(ex_set, new_info)
colnames(fData(with_new_info))
#> [1] "Feature_ID" "Split" "Alignment" "Average_Mz"
#> [5] "Average_Rt_min" "Column" "Ion_mode" "Flag"
#> [9] "Feature_number"