Learn R Programming

geoSpectral (version 0.17.5)

spc.export.text: Exporting into text format

Description

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

Usage

spc.export.text(
  input,
  filename,
  sep = ";",
  append = FALSE,
  writeheader = TRUE,
  ...
)

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

# S4 method for 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

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataLab