## Not run: library(xcms)
# library(faahKO) ## These files do not have this problem to correct for but just for an example
# cdfpath <- system.file("cdf", package = "faahKO")
# cdffiles <- list.files(cdfpath, recursive = TRUE, full.names = TRUE)
# xr<-xcmsRaw(cdffiles[1])
# xr
# ##Lets assume that the lockmass starts at 1 and is every 100 scans
# lockMass<-xcms:::makeacqNum(xr, freq=100, start=1)
# ## these are equcal
# lockmass<-AutoLockMass(xr)
# ob<-stitch(xr, lockMass)
# ob
#
# #plot the old data before correction
# foo<-rawEIC(xr, m=c(200,210), scan=c(80,140))
# plot(foo$scan, foo$intensity, type="h")
#
# #plot the new corrected data to see what changed
# foo<-rawEIC(ob, m=c(200,210), scan=c(80,140))
# plot(foo$scan, foo$intensity, type="h")
# ## End(Not run)
Run the code above in your browser using DataLab