create_dataset: Create dataset

create_datasetR Documentation

Create dataset

Description

Creates a dataset from a numeric matrix.

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 variables and columns are samples.

type

Type of data, such as "nmr-spectra", "nmr-peaks", "ir-spectra", "uvv-spectra", "concentrations", or "undefined".

metadata

Optional metadata as a data frame or matrix.

description

Dataset description.

sample.names

Optional sample names.

x.axis.values

Optional x-axis values.

label.x

Optional x-axis label.

label.values

Optional value label.

xSet

Optional xSet object.

Value

A list representing a specmine dataset. The returned object contains at least the elements data, a numeric matrix with variables in rows and samples in columns; type, a character string identifying the dataset type; description, a character string describing the dataset; metadata, a data frame with one row per sample when available; labels, a list with axis and value labels when provided; and xSet, an optional object associated with LC-MS processing. This object is the standard input structure used by downstream specmine analysis functions.

Examples

datamatrix <- matrix(
  c(1.1, 2.2, 3.3, 4.4, 5.5, 6.6),
  nrow = 2,
  dimnames = list(NULL, NULL)
)
metadata <- data.frame(
  class = c("A", "B", "A"),
  row.names = c("s1", "s2", "s3")
)
create_dataset(
  datamatrix,
  type = "concentrations",
  metadata = metadata,
  sample.names = c("s1", "s2", "s3"),
  x.axis.values = c("v1", "v2"),
  label.x = "variable",
  label.values = "intensity"
)


specmine documentation built on Aug. 5, 2026, 5:06 p.m.