Learn R Programming

MALDIquantForeign (version 0.14.1)

export,AbstractMassObject-method: Export files

Description

This function provides a general interface to export AbstractMassObject-class objects (e.g. MassSpectrum-class, MassPeaks-class) into different file formats.

Usage

# S4 method for AbstractMassObject
export(x, file, type="auto", force=FALSE, ...)

# S4 method for list export(x, path, type, force=FALSE, ...)

Arguments

x

a AbstractMassObject-class object or a list of AbstractMassObject-class objects.

file

character, file name.

type

character, file format. If type is set to “auto” the file extension is used.

force

logical, If TRUE the file would be overwritten or path would be created.

path

character, path to directory in which the list of AbstractMassObject-class would be exported.

...

arguments to be passed to specific export functions.

Author

Sebastian Gibb

Details

Specific export functions:

tabexportTab
csvexportCsv
imzMLexportImzMl
msdexportMsd
mzMLexportMzMl

References

https://strimmerlab.github.io/software/maldiquant/

See Also

MassPeaks-class, MassSpectrum-class

Examples

Run this code

if (FALSE) {
library("MALDIquant")
library("MALDIquantForeign")

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

## export a single spectrum
export(s[[1]], file="spectrum.csv")
## identical to exportCsv(s[[1]], file="spectrum.csv")

## export a list of spectra
export(s, path="spectra", type="csv")
## identical to exportCsv(s, path="spectra")
}

Run the code above in your browser using DataLab