Learn R Programming

specmine (version 3.1.6)

set_metadata: Set new metadata

Description

Updates the dataset's metadata with a new one.

Usage

set_metadata(dataset, new.metadata)

Arguments

dataset

list representing the dataset from a metabolomics experiment.

new.metadata

matrix or dataframe with the new metadata.

Value

Returns the dataset with the updated metadata.

Examples

Run this code
# NOT RUN {
  ## Example of setting a new metadata to the dataset
  library(specmine.datasets)
  data(cachexia)
  new.metadata = c(rep("meta1", 39), rep("meta2", 38)) 
  new.metadata = data.frame(var_meta = new.metadata)
  rownames(new.metadata) = get_sample_names(cachexia)
  cachexia = set_metadata(cachexia, new.metadata)
# }

Run the code above in your browser using DataLab