sidfex.fcst.search.addTableItem: DEPRECATED - Add single row to search index file

sidfex.fcst.search.addTableItemR Documentation

DEPRECATED - Add single row to search index file

Description

DEPRECATED (included in sidfex.fcst.search.createIndex) - Read one or SIDFEx forecast and add some key quantities and information to the (previously existing or not) index file "indexTable.rda". If the specified index file does not exist, a now one is created. The data will be stored in .rda-format.

Usage

  sidfex.fcst.search.addTableItem (filename, data.path=NULL, indexTable.path=NULL, is.open.rTab=FALSE, rTab.in=NULL, checkfileformat=TRUE, do.print.less=TRUE)

Arguments

filename

a character specifying the file to read. If the filename is provided with a leading filepath, set data.path = "".

data.path

NULL or a character specifying the directory where to find the forecast data locally. If NULL, it is attempted to source a file named .SIDFEx in the home directory where a character variable data.path.fcst needs to be defined.

indexTable.path

NULL or a character specifying the directory where to find or create the index file. If NULL, it is attempted to source a file named .SIDFEx in the home directory where a character variable data.path.indexTable.in needs to be defined.

is.open.rTab

a boolen value, default FALSE. The function can and will be used by other functions to add multiple rows one by one. To save I/O operations, it is possible to hand over the opened table by the overarching function. In that case set is.open.rTab = TRUE AND don't forget to deliver that table (a data frame) in rTab.in (see below).

rTab.in

a data frame which will be returned with one row appended if is.open.rTab = TRUE. rTab.in needs to be a data frame containing 18 columns, the respective column names are given below.

checkfileformat

a logical value specifying whether or not to check if the file format complies with the SIDFEx conventions, using sidfex.checkfileformat.

do.print.less

a logical value specifying whether or not to print a statement for every dataset while adding it to the index file (to keep console output down).

Value

If is.open.rTab = FALSE, this function returns 0 (old C++ habit of author and sometimes useful). If is.open.rTab = TRUE and (thus) rTab.in given, the function returns a copy of the input data frame with one appended row (if the row did not exist before).

Note

The above-mentioned columns of the data frame should be (exactly) this vector:

indexNames = c("File", "GroupID", "MethodID", "TargetID", "InitYear", "InitDayOfYear", "EnsMemNum", "SubmitYear", "SubmitDayOfYear", "ProcessedYear", "ProcessedDayOfYear", "Delay", "nTimeSteps", "FirstTimeStepYear", "FirstTimeStepDayOfYear", "LastTimeStepYear", "LastTimeStepDayOfYear", "FcstTime")

It is strongly suggested not to create the index file by hand, use the given functions instead to avoid problems or inconsistencies.

Author(s)

Simon Reifenberg

See Also

sidfex.fcst.search.createIndexTable, sidfex.fcst.search.extractFromTable, sidfex.fcst.search.rda2csv


helgegoessling/SIDFEx documentation built on March 15, 2024, 2:26 p.m.