Learn R Programming

enviPat (version 2.2)

getR: Interpolation of MS measurement resolution

Description

Given a set of MS measurement resolutions (R) as a function of measurement mass (m/z), getR interpolates R for any given molecular mass(es) calculated by check_chemform using smooth.spline.

Usage

getR(checked, resmass, nknots = 13, spar = 0.1, plotit = TRUE)

Arguments

checked
Dataframe produced by check_chemform.
resmass
Dataframe with two columns, resolution and mass; such as the list entries in resolution_list.
nknots
Integer number of knots to use for the smoothing spline. Default = 6. See also smooth.spline.
spar
Smoothing parameter, (0,1]. See also smooth.spline.
plotit
Plot results, TRUE/FALSE ?

Value

See Also

smooth.spline check_chemform resolution_list

Examples

Run this code

data(resolution_list)
resmass<-resolution_list[[4]]
data(isotopes)
data(chemforms)
checked<-check_chemform(isotopes,chemforms)
resolution<-getR(checked,resmass,nknots=13,spar=0.1,plotit=TRUE)

# same for z=-2:
checked<-check_chemform(isotopes,chemforms)
checked[,3]<-(checked[,3]/abs(-2))
resolution<-getR(checked,resmass,nknots=13,spar=0.1,plotit=TRUE)

Run the code above in your browser using DataLab