baselineAlg-class {baseline} | R Documentation

## Class "baselineAlg"

### Description

A class that describes a baseline correction algorithm. The idea is that it contains all information needed to use an algorithm with the optimisation framework and the graphical user interface (but see Notes below).

### Objects from the Class

Objects can be created by calls of the form `new("baselineAlg", ...)`.

### Slots

`name`:

  Short-name of the algorithm. This must match the name of the object in the `baselineAlgorithms` list of algorithms, and is used throughout the code to identify the algorithm. It should thus start with a letter and contain only letters, digits, underscores ("_") or dots (".").

`description`:

  Description of the algorithm, typically the full name. This will be used in the code to describe the algorith, so it should not be too long, and not contain newline characters.

`funcName`:

  The name of the function used to estimate the baseline. The function must take an argument `spectra`, and return a list with the estimated baselines (`baseline`) original spectra (`spectra`) and the corrected spectra (`corrected`). It can also take other arguments (typically parameters) and return additional components in the list.

`param`:

  A data frame with information about the parameters of the algorithm. It should contain the following coloumns: `name` - the name of the parameter; `integer` - `TRUE` if the parameter only takes integer values, otherwise `FALSE`; `min` - the lower limit of allowed values; `incl.min` - `TRUE` if the lower limit is an allowed value, otherwise `FALSE`; `default` - the default value; `max` - the upper limit of allowed values; `incl.max` - `TRUE` if the upper limit is an allowed value, otherwise `FALSE`

### Methods

description

  `signature(object = "baselineAlg")`: Extract the `description` slot

funcName

  `signature(object = "baselineAlg")`: Extract the `funcName` slot

name

  `signature(object = "baselineAlg")`: Extract the `name` slot

param

  `signature(object = "baselineAlg")`: Extract the `param` slot

### Note

The goal is that the optimisation framework and the GUI code should get all information about available baseline algorithms through a list of `baselineAlg` objects. This will make it relatively simple to add new baseline algorithms.

Currenly, there is information about the algorithms spread around in the code. We plan to move that information into the `baselineAlg` objects, and expand the class accordingly.

### Author(s)

Bjørn-Helge Mevik and Kristian Hovde Liland

### Examples

    showClass("baselineAlg")

[Package baseline version 1.2-1 Index]