# Load example data
data(spectra) # list of MassSpectra class objects
# Some pre-processing
spectra <- screenSpectra(spectra)$fspectra
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 as R file (saved to a temporary location as an example)
# \donttest{
writeIntensity(int, file = file.path(tempdir(), "int"))
# }
# Save as binary NEXUS file (saved to a temporary location as an example)
# \donttest{
writeIntensity(int, file = file.path(tempdir(),"int.binary"),
format = "NEXUS", interleaved = FALSE)
# }
Run the code above in your browser using DataLab