Learn R Programming

pems.utils (version 0.3.0.7)

6.3.corrections: Corrections

Description

Corrections are a special subset of functions which by default write over the elements that they recalculate.

Usage

correctInput(input = NULL, ..., data = NULL,
         correction = NULL)

zeroNegatives(input = NULL, ..., data = NULL, screen = FALSE)

correctBaseline(x, ..., data = NULL, output = "ans")

#associated

calcPack2(input, ..., settings = NULL, data = NULL)

Value

With the exception of calcPack2, all the above functions generate input corrections.

correctBaseline returns the supplied data time-series (x) after applying the requested baseline correction (see below).

Arguments

input

(Required data series typically vectors) The input to use when makin a correction. This is typically a vector or element in either a data.frame or pems object.

x

(For correctBaseline) (Required data series typically vectors) The input to use when makin a correction. This is typically a vector or element in either a data.frame or pems object.

...

(Optional) Other arguments, typically passed on.

data

(Optional data.frame or pems object) The data source if either a data.frame or pems object is being used.

correction

(For correctInput, required function) The correction operation to apply to input. This is typically a function or function name (as character string).

screen

(For zeroNegatives, logical) If the user intends screening the correction before applying it, this should be set to TRUE.

output

(character) Where options exists for the function output, the required output. For correctBaseline, current options: 'ans' (the default) and 'diagnostic'.

settings

(For calcPack2, list) Any arguments to be used as settings when handling pems.elements. Unless developing functions, this can typically be ignored.

Author

Karl Ropkins

Details

correctInput is a general correction handlers. It accepts an input and a function, correction, which it applies to input.

zeroNegatives resets any negative values in an input to zero.

correctBaseline attempts to correct the baseline of a supplied data (pems.element vector) time-series. Baseline corrections are carried out using methods from the baseline package. See Below.

calcPack2 is an alternative version of calcPack. See associated help for details.

References

baseline:

Kristian Hovde Liland and Bjorn-Helge Mevik (2015). baseline: Baseline Correction of Spectra. R package version 1.2-1. https://CRAN.R-project.org/package=baseline

See Also

baseline regarding baseline corrections.

common.calculations, calcVSP or calcEm for calculation functions.

getElement (checkUnits, etc and convertUnits for data management.

Examples

Run this code

###########
##example 1 
###########

#basic usage

zeroNegatives(-10:10) #etc



Run the code above in your browser using DataLab