simple_chroma: Simulate simple chromatograms

View source: R/simple_chroma.R

simple_chromaR Documentation

Simulate simple chromatograms

Description

Creates chromatograms with user defined peaks for illustrative purposes. Linear drift is applied in sample order if more than one sample is created. See parameters of the function.

Usage

simple_chroma(
  peaks = c(10, 13, 25, 37, 50),
  N = 1,
  min = 0,
  max = 30,
  Names = NULL,
  sd = NULL
)

Arguments

peaks

A numeric vector giving the retention times on which gaussian distribution, defining peaks, are centered. If more than one sample is generated N > 1, peaks defines a population of peaks, from which samples are generated.

N

An integer giving the number of chromatograms to create. By default N = 1.

min

A numeric giving the minimum retention time.

max

A numeric giving the maximum retention time.

Names

A character vector giving sample names. If not specified, names are generated automatically.

sd

A numeric vector of the same length as peaks giving the standard deviation of each peak. Only supported if N = 1.

Value

A data frame containing x and y coordinates and corresponding sample names.

Author(s)

Meinolf Ottensmann (meinolf.ottensmann@web.de) & Martin Stoffel (martin.adam.stoffel@gmail.com)

Examples

## create a chromatogram
x <- simple_chroma(peaks = c(5,10,15), N = 1, min = 0, max = 30, Names = "MyChroma")
## plot chromatogram
with(x, plot(x,y, xlab = "time", ylab = "intensity"))


mastoffel/GCalignR documentation built on Feb. 4, 2024, 2:39 p.m.