flip_() re-orientates/flips the spectrum on the x axis so that the peaks are pointing the correct way.

flip_(x, p, sh)

Arguments

x

the spectra wanting to be flipped

p

the match ppm variable

sh

the chemical shift used to calculate orientation given as the upper and lower ppm bounds

Value

Returns a spectrum (array) with the correct orientation

Details

flip_() looks at the chemical shift provided by the sh variable and sums the x values in that area. It then determines if the sum of this area has a positive or negative sign (indicating if in that area, the peak is pointing in the positive or negative direction). If it is in the negative direction, the entire spectrum is mulitplied by -1 and returned.

See also

Other preproc: bl_(), cali(), pproc(), readin()

Author

Kyle Bario kylebario1@gmail.com

Examples

readin(path = system.file('extdata/15', package = 'NMRadjustr')) xf <- flip_(x, p, sh = c(3,3.1))