read_rw_csv function

Read RiverWare/RiverSMART produced csv files

Read RiverWare/RiverSMART produced csv files

read_rw_csv() reads in a CSV file created from RiverWare. If the CSV file does not contain column names that RiverWare always uses (see Details), then it assumes that the CSV file was not created from RiverWare and throws an error. It also removes spaces from the column names, and adjusts the Object.Slot and Slot Value columns to be ObjectSlot and Value, respectively.

read_rw_csv(file)

Arguments

  • file: The name of the file which the data are to be read from. Either an absolute or relative path.

Returns

A tibble (data frame) containing the data in the csv.

Details

The required column names are: Run Number, Trace Number, Object.Slot, Timestep, Slot Value. See the CSV output section of the RiverWare documentation

for more information on the other optional column names.

This function uses data.table::fread() to read in the CSV file, and forces it to expect a CSV file, expect headers, and return data.frame.

Examples

zz <- read_rw_csv(system.file( "extdata/Scenario/ISM1988_2014,2007Dems,IG,Most", "KeySlots.csv", package = "RWDataPlyr" ))

See Also

read.rdf()

Other functions in RWDataPlyr

Related functions from the same R package