Learn R Programming

DWBmodelUN (version 1.0.0)

varBasins: value of a variable in each subbasin

Description

This function retrieves the value of a variable in each of the cells that are within a basin boundary. It also returns the average time series value of the variable.

Usage

varBasins(var, cellBasins)

Arguments

var

one of the dataframe results returned from the DWBcalculator function

cellBasins

first entry of the cellBasins function that consists of a list of vectors. Each one of the vectors contains the cell numbers of each basin

Value

a list of two elements. The first one is the time series average value of the variable, and the second is a list of dataframes each one of them contains the time series of each of the cells that are within a basin

Examples

Run this code
# NOT RUN {
data(sogamoso,GRU,basins)
dwb_results <- sogamoso$dwb_results
Run <- dwb_results$q_total
cellBasins <- cellBasins(GRU, basins)
cellBasins <- cellBasins$cellBasins

Runoff.Sogamoso <- varBasins(Run, cellBasins)

# }

Run the code above in your browser using DataLab