flip: flipping spectra

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/flip.R

Description

Spectra produced from experiments with small scans can often appear upside-down. This function corrects this.

Usage

1
flip(X, ppm, shift = c(3, 3.1))

Arguments

X

The numerical matrix containing the NMR data you wish to check for orientation. The rows must contain information of one whole spectrum and the columns contain the specific chemical shift variables.

ppm

An array of chemical shift variables. ppm should be column matched to the X matrix you are normalising.

shift

The concatenated ppm values that define the lower and upper bounds of the creatinine signal. Default is c(3,3.1)

Details

NMR urine spectra that are produced from a small number of scans are often incorrectly orientated due to the water signal. This function looks at the creatinine signal (ppm = 3.05) which is in all urine spectra to see if the value is positive or negative. For negative valued spectra, they are mulitplied by -1 and flipped to the correct orientation.

Value

Returns the original X matrix but with all values with the correct sign.

Author(s)

kylebario1@gmail.com

See Also

Other Data_Manipulation: binin(), bl()

Examples

1
2
path = system.file('extdata', package = 'unorm')
Xf <- flip(X, ppm)

kylebario/unorm documentation built on Dec. 21, 2021, 8:45 a.m.