WriteTimeOutput: Write a 'timeXXXX.txt' file

View source: R/functioncollection_export.R

WriteTimeOutputR Documentation

Write a 'timeXXXX.txt' file

Description

Function to export a time output file from R.

Usage

WriteTimeOutput(x, filename, dt.format = "%Y-%m-%d")

Arguments

x

The object to be written, a dataframe with comment and subid attributes, as an object returned from ReadTimeOutput.

filename

A character string naming a file to write to. Windows users: Note that Paths are separated by '/', not '\'.

dt.format

Date-time format string as in strptime. Incomplete format strings for monthly and annual values allowed, e.g. '\%Y'.

Details

WriteTimeOutput exports a data frame with headers and formatting options adjusted to match HYPE's time output files.

Value

No return value, called for export to text files.

Examples

te <- ReadTimeOutput(filename = system.file("demo_model", "results", "timeCOUT.txt", 
                     package = "HYPEtools"), dt.format = "%Y-%m")
WriteTimeOutput(x = te, filename = tempfile(), dt.format = "%Y-%m")


HYPEtools documentation built on Sept. 11, 2024, 8:34 p.m.