Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

exportTab-methods

Export to text files


Description

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

Usage

## S4 method for signature 'AbstractMassObject'
exportTab(x, file, force=FALSE, ...)

## S4 method for signature 'list'
exportTab(x, path, force=FALSE, ...)

## S4 method for signature 'AbstractMassObject'
exportCsv(x, file, force=FALSE, ...)

## S4 method for signature 'list'
exportCsv(x, path, force=FALSE, ...)

Arguments

x

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

file

character, file name.

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 write.table.

Details

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

Author(s)

Sebastian Gibb

References

See Also

Examples

## Not run: 
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)

## End(Not run)

MALDIquantForeign

Import/Export Routines for 'MALDIquant'

v0.12
GPL (>= 3)
Authors
Sebastian Gibb [aut, cre] (<https://orcid.org/0000-0001-7406-4443>), Pietro Franceschi [ctb]
Initial release
2019-01-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.