loadTabularData: Load Tabular Hydro-Meteorological Data

View source: R/loadTabularData.R

loadTabularDataR Documentation

Load Tabular Hydro-Meteorological Data

Description

Loads csv files with tabular hydrometeorological data where years are in rows and decades or months are in columns. The function automatically detects if monthly or decadal (10-day) data is provided. The function automatically computes the long-term norm of the data provided and returns a time aware tibble with date, data, data norm columns and code columns.

Usage

loadTabularData(
  fPath,
  fName,
  code,
  stationName,
  rName,
  rBasin,
  dataType,
  units
)

Arguments

fPath

Path to the input file

fName

File name (.csv file as input required)

code

Hydrometeorological station code

stationName

Hydrometeorological station name/location

rName

Name of river

rBasin

Name of basin

dataType

Type of data, either 'Q' (discharge data), 'T' (temperature data) or 'P' (precipitation data)

units

Data units

Details

Note that the input file needs to be in coma-separated format and without header.

The most common format for hydrological data in Central Asia is in tabular form with the years in rows and the months or decades in columns, i.e. the data has 13 columns and as many rows as years of data. An input file containing monthly data might look like follows:
1990,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.3,0.2,0.1,0.1
1991,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.3,0.2,0.1,0.1
1992,0.1,0.1,0.2,0.2,0.3,0.3,0.4,0.4,0.3,0.2,0.1,0.1
...
An input file containing decadal data (every 10 days) would have 37 columns, the first for the year and the following for each decade in a year.

Value

Time-aware tibble with relevant data

See Also

Other Pre-processing: convert2HYY(), doQuantileMapping(), gen_HRU_Climate_CSV_RSMinerve(), gen_basinElevationBands(), plotNormDevHYY()

Examples

## Not run: 
demo_data <- loadTabularData(
  fPath = "./",
  fName = "discharge.csv",
  code = "ABC",
  stationName = "DemoStation",
  rName = "Demo River",
  rBasin = "Demo Basin",
  dataType = "Q",
  unit = "m3/s")

## End(Not run)

hydrosolutions/riversCentralAsia documentation built on Feb. 7, 2023, 4:50 p.m.