simSpectra: [!] Simulate spectroscopic data

View source: R/simSpectra.R

simSpectraR Documentation

[!] Simulate spectroscopic data

Description

Simulation of spectroscopic data: Loadings (spectra of spectroscopic components), Scores (amplitudes of these components) an Spectra (mixture of the spectroscopic components multiplied by the amplitudes with random noise added).

Usage

simSpectra(
  x = 300:800,
  nGr = 2,
  nInGr = c(50, 50, 50),
  N = sum(nInGr),
  nDim = 4,
  w.possile = 5:150,
  plots = FALSE
)

Arguments

x

Values for x axis ("wavelengths").

nGr

Number of groups.

nInGr

Number of samples in a group (vector of values for each group).

N

Total number of samples.

nDim

Number of spectral components (dimensions).

w.possile

A vector of possible values of Gaussian curve parameter "w' (i.e., width). Values of w will be randomly sampled from this vector.

plots

Logical. If TRUE - makes plots. Default is FALSE.

Details

[This function works, but is not well documented yet.]

Value

List of hyperSpec objects:

Spectra

Spectra of each observation, made of (Scores * Loadings) + NOISE.

Loadings

Normalized spectra of components.

Scores

Amplitudes of components for each observation.

In the list the hyperSpec objects contain spectroscopic data and additional variables.

Additional variables for Spectra and Scores:

class

A factor variable for classification.

gr

A factor variable for other type classification.

Additional variables for Loadings:

PeakAt

Position of components top peak.

cNames

Names of components.

order.of.rows

Original order of components before sorting.

Author(s)

Vilmantas Gegzna

Examples


simSpectra()

simSpectra()$Spectra


GegznaV/spHelper documentation built on April 16, 2023, 1:42 p.m.