WriteTS: Write Time Series

View source: R/WriteTS.R

WriteTSR Documentation

Write Time Series

Description

Save series consisting of Time and SeriesVal and eventual further texts to a *.TS file.

Usage

WriteTS(FileName, Time, SeriesVal, FurtherTexts, Header, OutDirectory = getwd(), ForceNumeric = FALSE, Comments)

Arguments

FileName

String, name of the file to be written

Time

[1:n] vector of row type, typically UnixTime or other time in seconds: unique key for each line, by default: [1:n]

SeriesVal

[1:n] vector with text without blanks or numerical data to be put in each line

FurtherTexts

Optional: [1:n,1:c] string matrix with row FurtherTexts to be put in third column

Header

Optional: [1:(c+1)] vector for the headers including for the names and FurtherTexts: Array of chars, this line will be inserted at top of file with leading #

F

OutDirectory

Optional: The OutDirectory where to write into; if not given: current dir

ForceNumeric

Optional: TRUE: saves numeric format of SeriesVal, FALSE: accepts text

Comments

Optional: Vector, Char Array or matrix, these lines will be inserted at top of file with leading #

Note: Also allowed: Comments='first line \n # second line'

Author(s)

Michael Thrun

See Also

ReadTS

Examples

data(ElectricityBRD)
WriteTS("ElectricityBRD", ElectricityBRD$Time, ElectricityBRD$Mrd_KWh)

Mthrun/TSAT documentation built on Feb. 5, 2024, 11:15 p.m.