## load package
library("MALDIquant")
## load example data
data("fiedler2009subset", package="MALDIquant")
## select only one spectrum
s <- fiedler2009subset[[1]]
## remove all mass lower 3000
trim(s, range=c(3000, Inf))
## remove all mass higher 8000
trim(s, range=c(0, 8000))
## remove all mass lower 3000 and higher 8000
trim(s, range=c(3000, 8000))
## choose largest overlapping mass range for all spectra
trim(fiedler2009subset)
Run the code above in your browser using DataLab