get_idx: Get Index

View source: R/get_idx.R

get_idxR Documentation

Get Index

Description

Find the elements of ppm that reside between to points

Usage

get_idx(sh, ppm)

Arguments

sh

The lower and upper bounds (2 numeric values) of the chemical shift region you wish to get the index for in ppm

ppm

The ppm variable matched to your X

Details

get_idx() asks what ppm values are between the points specified in the arg sh and returns this as an array

Value

A numerical array of values that can be used to index both ppm and X to specify a region to visualise or work on

See Also

Other estimation: lw(), noise(), shift_pickr()

Examples

# You want to visualise the Creatinine peak in your spectra
data(X, ppm)
idx <- get_idx(sh = c(3, 3.1), ppm = ppm)
plot(ppm[idx], X[1,idx], main = "The Creatinine Peak Found Using get_idx()",
     xlab = "Chemical Shift (ppm)", ylab = "Intensity", type = 'l')

kylebario/concentr8r documentation built on Nov. 9, 2022, 12:47 a.m.