
Update Variable Information in a mass_dataset Object
Source:R/update_mass_dataset.R
update_variable_info.RdThis function updates the variable_info and variable_info_note slots of a mass_dataset object.
It ensures that the columns in variable_info are consistent with the names in variable_info_note.
Author
Xiaotao Shen xiaotao.shen@outlook.com
Examples
data("expression_data")
data("sample_info")
data("variable_info")
object <- create_mass_dataset(
expression_data = expression_data,
sample_info = sample_info,
variable_info = variable_info
)
updated_md <- update_variable_info(object)
head(extract_variable_info(updated_md))
#> variable_id mz rt
#> 1 M136T55_2_POS 136.06140 54.97902
#> 2 M79T35_POS 79.05394 35.36550
#> 3 M307T548_POS 307.14035 547.56641
#> 4 M183T224_POS 183.06209 224.32777
#> 5 M349T47_POS 349.01584 47.00262
#> 6 M182T828_POS 181.99775 828.35712
head(extract_variable_info_note(updated_md))
#> name meaning
#> 1 variable_id variable_id
#> 2 mz mz
#> 3 rt rt