as.data.frame {airGRteaching}R Documentation

Function to coerce the outputs of PrepGR, CalGR and SimGR to a data.frame

Description

Function to coerce the outputs of PrepGR, CalGR and SimGR to a data.frame

Usage

## S3 method for class 'PrepGR'
as.data.frame(x, row.names = NULL, ...)

## S3 method for class 'CalGR'
as.data.frame(x, row.names = NULL, ...)

## S3 method for class 'SimGR'
as.data.frame(x, row.names = NULL, ...)

Arguments

x

[PrepGR], [CalGR] or [SimGR] objects

row.names

NULL or a character vector giving the row names for the data.frame. Missing values are not allowed

...

additional arguments to be passed to or from methods

Value

[data.frame] containing:

Dates

[POSIXct] vector of dates

PotEvap

[numeric] time series of potential evapotranspiration (catchment average) [mm/time step]

PrecipObs

[numeric] time series of total precipitation (catchment average) [mm/time step]

PrecipFracSolid_CemaNeige

[numeric] time series of solid precipitation fraction (layer average) [-], must be defined if CemaNeige is used

TempMeanSim_CemaNeige

[numeric] time series of mean air temperature (layer average) [°C], must be defined if CemaNeige is used

Qobs

[numeric] time series of observed flow (for the same time steps than simulated) [mm/time step]

Qsim

[numeric] time series of simulated flow (for the same time steps than simulated) [mm/time step] (only for objects of class CalGR or SimGR)

Author(s)

Olivier Delaigue

See Also

PrepGR, CalGR, SimGR

Examples

library(airGRteaching)

## data.frame of observed data
data(L0123001, package = "airGR")
BasinObs2 <- BasinObs[, c("DatesR", "P", "E", "Qmm", "T")]

## Preparation of observed data for modelling
PREP <- PrepGR(ObsDF = BasinObs2, HydroModel = "GR4J", CemaNeige = FALSE)
head(as.data.frame(PREP))

## Calibration step
CAL <- CalGR(PrepGR = PREP, CalCrit = "KGE2",
             WupPer = NULL, CalPer = c("1990-01-01", "1991-12-31"))
head(as.data.frame(CAL))

## Simulation step using the result of the automatic calibration method to set the model parameters
SIM <- SimGR(PrepGR = PREP, CalGR = CAL, EffCrit = "KGE2",
             WupPer = NULL, SimPer = c("1992-01-01", "1992-12-31"))
head(as.data.frame(SIM))

[Package airGRteaching version 0.3.3 Index]