set_metadata: Set new metadata

Description Usage Arguments Value Examples

Description

Updates the dataset's metadata with a new one.

Usage

1
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

1
2
3
4
5
6
7
  ## 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)

specmine documentation built on Sept. 21, 2021, 5:06 p.m.