## Not run:
# rcdata <- subset(spec$peaksMatched, formulaCount==1)
# ms1data <- recalibrate.addMS1data(spec, mode, 15)
# rcdata <- rbind(rcdata, ms1data)
# rcdata$recalfield <- rcdata$dppm
# rcCurve <- recalibrate.loess(rcdata)
# # define a spectrum and recalibrate it
# s <- matrix(c(100,150,200,88.8887,95.0005,222.2223), ncol=2)
# colnames(s) <- c("mz", "int")
# recalS <- recalibrateSingleSpec(s, rcCurve)
#
# Alternative: define an custom recalibrator function with different parameters
# recalibrate.MyOwnLoess <- function(rcdata)
# {
# return(loess(recalfield ~ mzFound, data=rcdata, family=c("symmetric"),
# degree = 2, span=0.4))
# }
# # This can then be specified in the RMassBank settings file:
# # recalibrateMS1: common
# # recalibrator:
# # MS1: recalibrate.loess
# # MS2: recalibrate.MyOwnLoess")
# # [...]
# ## End(Not run)
Run the code above in your browser using DataLab