# Load example data
data(spectra) # list of MassSpectra class objects
data(type) # metadata
# Some pre-processing
sc.spectra <- screenSpectra(spectra, meta = type)
spectra <- sc.spectra$fspectra # filtered spectra
type <- sc.spectra$fmeta # filtered metadata
spectra <- transformIntensity(spectra, method = "sqrt")
spectra <- wavSmoothing(spectra)
spectra <- removeBaseline(spectra)
peaks <- detectPeaks(spectra)
peaks <- alignPeaks(peaks, minFreq = 0.8)
# Intensity matrix
int <- intensityMatrix(peaks)
# Save resulting data in R format (to a temporary location as an example)
# \donttest{
writeIntensity(int, filename = file.path(tempdir(),"MyintMatrix"))
writeMetadata(type, filename = file.path(tempdir(),"MyMetadata"))
# }
# Save resulting data in csv format (to a temporary location as an example)
# \donttest{
writeIntensity(int, filename = file.path(tempdir(),"MyintMatrix"),
format = "csv")
writeMetadata(type, filename = file.path(tempdir(),"MyMetadata"),
format = "csv")
# }
Run the code above in your browser using DataLab