createSlotAggList: Creates a list for use by 'getDataForAllScens'.

Description Usage Arguments Details Value See Also Examples

View source: R/createSlotAggList.R

Description

createSlotAggList creates a list that specifies for each slot: which rdf file to find each slot in, how to aggregate and process the slot data, and any thresholds or scaling factors. The function can either read in a csv file or start from an Nx4 or Nx5 string matrix (the 5th column is optional).

Usage

1

Arguments

iData

Either an Nx4 string matrix or a string with an absolute or relative path to a csv file.

Details

The csv file and the matrix should be in the form of an Nx4 or Nx5 matrix. Each row is a single slot, aggregation, and threshold combination. If you want to compare a single slot value to multiple thresholds, it needs to have one row for each threshold. The first column is the rdf the slot is found in. The second column is the slot name. The third column is the aggregation method that will be applied to the slot (see below for a list of the aggregation methods). The fourth column is a scaling factor or threshold to compare the slot data to. The fifth column is an optional column; if specified, the 5th column will be used for the variable name for the data table created by getDataForAllScens. If it is not specified the variable name will be created by concatenating the slot, aggregation method, and threshold/scaling factor using '_' to seperate the columns. Below is an example table. All values should be strings except for NA.

rdf Slot Aggregation Method Threshold or Scaling Factor Variable Name (optional)
'KeySlots.rdf' 'Powell.Pool Elevation' 'EOCY' NA Powell EOCY Elevation
'KeySlots.rdf' 'Mead.Pool Elevation' 'AnnMinLTE' '1100' Mead < 1,100
'KeySlots.rdf' 'Mead.Pool Elevation' 'AnnMinLTE' '1060' Mead < 1,060
'Other.rdf' 'Powell.Outflow' 'AnnualSum' '0.001' Powell Annual Release

The above table lists each slot, the rdf the slot is saved in, the summary function, the threshold to be used to scale the data by or compare the data to, and an optional specified variable name. The threshold and scaling factors are described in more detail below. For example, the first row will result in compiling all end-of-December values for Powell's pool elevation. The data will not be scaled, and is found in KeySlots.rdf. The second row will find the annual minimum Mead pool elevation and see if it is less than or equal to 1,100' feet in the second line and less than or equal to 1,060' feet in the third row. To scale the data by a value less than 1, use decimals rather than fractions, as shown in the fourth row. If the Variable Name column was not specified, the variable name for the first row would be Powell.Pool Elevation_EOCY_1 as NA is replaced with a 1 when construcing the variable names.

The available aggregation methods are as follows. The behaviour of the "Threshold or scaling factor are described and a bold "Threshold" or "Scaled" indicate which is used by the aggregation method. For scaling factors, a value of "NA" will not scale the data.

'AnnMin'

Returns the minimum annual scaled value.

'AnnMax'

Returns the maximum annual scaled value.

'AnnualSum'

Returns the annual scaled sum.

'AnnMinLTE'

Checks to see if the annual minimum value is less than or equal to a threshold. Returns 100 if it is less than or equal to the threshold and 0 otherwise.

'AnnualRaw'

Returns the annual scaled data. This aggregation method should only be used if the rdf file contains only annual data. For rdf files that include monthly data and only an annual value is desired, the EOCY aggregation method should be used. This differs from the Monthly aggregation method, only in the timestep naming.

'BOCY'

Beginning-of-calendar year values are reported and scaled. Any values that are NaNs are changed to 0s.

'EOCY'

End-of-calendar year values are reported and scaled. Any values that are NaNs are changed to 0s.

'EOCYGTE'

Checks to see if the end-of-calendar year values are greater than or equal to a threshold. Returns 100 if it is greater than or equal to the threshold and 0 otherwise.

'EOCYLTE'

Checks to see if the end-of-calendar year values are less than or equal to a threshold. Returns 100 if it is less than or equal to the threshold and 0 otherwise.

'EOWY'

End-of-water year values are reported and scaled. Any values that are NaNs are changed to 0s.

'Monthly'

Returns the monthly scaled data.

'WYMinLTE'

Checks to see if the minimum water year value is less than or equal to a threshold. Returns 100 if it is less than or equal to the threshold and 0 otherwise. The water year is defined as October through September of the next year. For the first year, only January through September are evaluated as RiveWare does not typcially export pre-simulation data.

Value

A multi level list.

See Also

getDataForAllScens

Examples

1
createSlotAggList(system.file('extdata','SlotAggTable.csv',package = 'RWDataPlot'))

rabutler/RWDataPlot documentation built on June 6, 2017, 4:27 p.m.