write.drift: Write DRIFT-spectrum object in Spectrotest format

Description Usage Arguments Details Value See Also Examples

View source: R/drift_write.R

Description

Write object of S3-class drift in Spectrotest format to text file or connection. Spectrotest format is a CSV-compatible text format with special meta-tags, so it could be easily opened by any spreadsheet software.

Usage

1
write.drift(x, file = "")

Arguments

x

an object of S3-class drift.

file

a connection object or a character string naming the file to write to.

Details

Argument file has the same meaning as in write.

Value

Spectrotest formatted string, invisibly.

See Also

Other drift: as.data.frame.drift(), cbind.drift(), channel(), coal_drift(), diff.drift(), median.drift(), plot.drift(), read.drift(), slice()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
 s <- coal_drift()

 # Write to text file:
 write.drift(s, "s.ir")

 # Write to connection:
 con <- xzfile("s.xz", open = "w")
 write.drift(s, con)
 close(con)
 rm(con)

 # Light unit tests:
 s0 <- read.drift("s.ir")
 stopifnot(all(s0 == s))
 unlink("s.ir")

 con <- xzfile("s.xz", open = "r")
 s0 <- read.drift(con)
 close(con)
 rm(con)
 stopifnot(all(s0 == s))
 unlink("s.xz")

omega1x/spectrotest documentation built on Oct. 1, 2020, 4 p.m.