Learn R Programming

MALDIquantForeign (version 0.2)

exportTab: Export to text files

Description

This function exports AbstractMassObject-class objects (e.g. MassSpectrum-class, MassPeaks-class) into different text file formats.

Arguments

x
a AbstractMassObject-class object or a list of AbstractMassObject-class objects.
file
character, file name.
path
character, path to directory in which the list of AbstractMassObject-class would be exported.
force
logical, If TRUE the file would be overwritten or path would be created.
...
arguments to be passed to write.table.

Details

exportTab and exportCsv use write.table with different defaults (sep="t" in exportTab and sep="," in exportCsv).

References

http://strimmerlab.org/software/maldiquant/

See Also

MassPeaks-class, MassSpectrum-class, write.table

Examples

Run this code
library("MALDIquant")
library("MALDIquantForeign")

s <- list(createMassSpectrum(mass=1:5, intensity=1:5),
          createMassSpectrum(mass=1:5, intensity=1:5))

## export a single spectrum
exportTab(s[[1]], file="spectrum.tab")

## export a list of spectra and use ; as separator
exportCsv(s, path="spectra", sep=";", force=TRUE)

Run the code above in your browser using DataLab