Learn R Programming

specmine (version 3.1.6)

metadata_as_variables: Metadata as variables

Description

Use one or more metadata variables as variables.

Usage

metadata_as_variables(dataset, metadata.vars, by.index = FALSE)

Arguments

dataset

list representing the dataset from a metabolomics experiment.

metadata.vars

name or index of the metadata variables that are going to be used as data variables.

by.index

boolean value indicating if the metadata variables are indexes or names

Value

Returns the dataset with the metadata variables removed from the metadata and added on the data matrix.

Examples

Run this code
# NOT RUN {
  ## Example of using a metadata variable as data variable
  library(specmine.datasets)
  data(propolis)
  propolis = metadata_as_variables(propolis, "seasons", by.index = FALSE)
# }

Run the code above in your browser using DataLab