Learn R Programming

specmine (version 1.0)

create_dataset: Create dataset

Description

Create a dataset from existing objects

Usage

create_dataset(datamatrix, type = "undefined", metadata = NULL, 
description = "", sample.names = NULL, x.axis.values = NULL,
label.x = NULL, label.values = NULL, xSet = NULL)

Arguments

datamatrix
matrix with numerical data: rows are assumed to be variables and columns assumed to be samples.
type
type of data: string that can be one of the following:
  • nmr-spectra
  • nmr-peaks
  • ir-spectra
  • uvv-spectra
  • raman-spectra
  • fluor-spectra
  • ms-spectra
  • lcms-peaks
  • gcms-peaks
  • integrated-d
metadata
data frame with the dataset's metadata: columns represent each metadata variable and rows represent the value of the metadata for the sample.
description
string with a short description of the dataset.
sample.names
vector with sample names, if NULL then the column names of datamatrix or sequential numbers will be used.
x.axis.values
vector with the x axis values, if NULL then the row names of datamatrix or sequential numbers will be used.
label.x
x axis label.
label.values
values label.
xSet
xcmsSet object from xcms package to store the reading and preprocessing results from MS spectra. Used for metabolite identification purposes.

Value

  • list representing the dataset:
  • datamatrix with the data
  • typetype of the data
  • descriptionshort description of the dataset
  • metadatadata frame with the metadata variables
  • labelslist with labels of x axis and values
  • xSetxcmsSet object

Examples

Run this code
## Example of creating a dataset
  dataset = create_dataset(datamatrix, type = "nmr-spectra", 
	metadata = dataset.metadata, description = "shortdescription", 
	sample.names = NULL, x.axis.values = NULL, label.x = "ppm", 
	label.values = "intensity")

Run the code above in your browser using DataLab