prep.data: Prepare P_IZ and T_IZ data for use in COSERO

View source: R/prep.data.r

prep.dataR Documentation

Prepare P_IZ and T_IZ data for use in COSERO

Description

Prepare a P_IZ or T_IZ file to be processed by COSERO. Any missing values can be filled using nalocf. The output can be divided into hydrological years.

Usage

prep.data(x, filename, fill = TRUE, divide = NULL, fmt = "%6.1f", ...)

Arguments

x

an xts object, normally created by reading a T_IZ or P_IZ file using read.xts

filename

character string for the output file(s)

fill

logical. Should missing values be filled (see fill.missing for details)

divide

NULL or "years". If "years", x will be divided into hydrological years

fmt

character string passed on to sprintf via write.xts for formatting numerical values. If NULL, no special format is used.

...

further arguments passed to write.xts

Details

If the output is divided more than one file is written. The filename then is extended by the hydrological year (e.g. file_2019.txt for the period from 2018-10-01 to 2019-09-30)

Value

an xts object (if divide == NULL) or a list with xts objects

Author(s)

Simon Frey

See Also

write.xts


freysimon/jaguR documentation built on June 29, 2023, 4:28 p.m.