spc.export.text: Exporting into text format

Description Usage Arguments See Also Examples

Description

Save the Spectra and SpcHeader objects on disk in text format and read back in.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
spc.export.text(
  input,
  filename,
  sep = ";",
  append = FALSE,
  writeheader = TRUE,
  ...
)

## S4 method for signature 'Spectra'
spc.export.text(
  input,
  filename,
  sep = ";",
  append = FALSE,
  writeheader = TRUE,
  ...
)

## S4 method for signature 'SpcHeader'
spc.export.text(
  input,
  filename,
  sep = ";",
  append = FALSE,
  writeheader = TRUE,
  ...
)

spc.import.text(filename, sep = ";", ...)

Arguments

input

A Spectra object

filename

Name of the output text file

sep

character. the field separator string

append

logical. Only relevant if file is a character string. Default is TRUE

writeheader

either a logical value indicating whether the header names are to be written

...

arguments to be passed to or from other methods

See Also

spc.import.text

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
x=spc.example_spectra()
fn <- tempfile()
spc.export.text(x,filename=fn)
aa=spc.import.text(fn)
dev.new()
spc.plot(aa)

#Export the SpcHeader object
fn2 <- tempfile()
spc.export.text(x@header, filename=fn2)
hdr=spc.import.text(fn2)
class(hdr)

PranaGeo/geoSpectral documentation built on Feb. 21, 2020, 10:22 a.m.