## load library
library("MALDIquant");
## load example data
data("spectra", package="MALDIquant");
## choose only the first mass spectrum
s <- spectra[[1]];
## transform intensities
s <- transformIntensity(s, sqrt);
## remove baseline
s <- removeBaseline(s);
## plot spectrum
plot(s);
## find local maxima
m <- findLocalMaxima(s);
## draw maxima on the plot
points(m, col="red");Run the code above in your browser using DataLab