dyplot.default.Rd 3.76 KB
Newer Older
unknown's avatar
unknown committed
1
2
3
4
\encoding{UTF-8}
\name{dyplot}
\alias{dyplot.default}
\alias{dyplot}
5
6


7
\title{Interactive plots for time series of PrepGR, CalGR and SimGR objects}
unknown's avatar
unknown committed
8
9


10
\description{Interactive plots for time series of \emph{PrepGR}, \emph{CalGR} and \emph{SimGR} objects.}
11
12


unknown's avatar
unknown committed
13
\usage{
14
\method{dyplot}{default}(x, Qsup = NULL, Qsup.name = "Qsup",
15
16
17
18
19
       col.Precip = c("royalblue", "lightblue"),
       col.Q = c("black", "orangered", "grey"), col.na = "lightgrey",
       ylab = NULL, main = NULL,
       plot.na = TRUE, RangeSelector = TRUE, Roller = FALSE,
       LegendShow = c("follow", "auto", "always", "onmouseover", "never"), ...)
unknown's avatar
unknown committed
20
21
22
23
}


\arguments{
24
25
  \item{x}{[PrepGR], [CalGR] or [SimGR] containing the vector of dates (\emph{POSIXt}) and the time series of numeric values list perturbed inputs and DA model outputs (see \code{\link{PrepGR}}, \code{\link{CalGR}} and \code{\link{SimGR}})}
  
26
  \item{Qsup}{(optional) [numeric] additional time series of flows (at the same time step than argument \code{x}) [mm/time step]}
27
28
29
  
  \item{Qsup.name}{(optional) [character] a label for the legend of Qsup}
  
30
  \item{col.Precip}{(optional) [character] vector of 1 (total precip.) or 2 (liquid and solid precip. with CemaNeige) color codes or names for precipitation (these can be of the form \code{"#AABBCC"} or \code{"rgb(255, 100, 200)"} or \code{"yellow"}), see \code{\link[graphics]{par}} and \code{\link[grDevices]{rgb}}}
unknown's avatar
unknown committed
31

32
  \item{col.Q}{(optional) [character] vector of up to 3 color codes or names for observed (first value), simulated (second value, if provided) and additional (last value, if provided) flows, respectively (these can be of the form \code{"#AABBCC"} or \code{"rgb(255, 100, 200)"} or \code{"yellow"}), see \code{\link[graphics]{par}} and \code{\link[grDevices]{rgb}}}  
unknown's avatar
unknown committed
33
  
34
  \item{col.na}{(optional) [character] color code or name for missing values(these can be of the form \code{"#AABBCC"} or \code{"rgb(255, 100, 200)"} or \code{"yellow"}), see \code{\link[graphics]{par}} and \code{\link[grDevices]{rgb}}}
35
  
36
  \item{ylab}{(optional) [character] a label for the y-axis (flow and precipitation)}
unknown's avatar
unknown committed
37
  
38
  \item{main}{(optional) [character] a main title for the plot}
unknown's avatar
unknown committed
39
  
40
  \item{plot.na}{[boolean] indicating if the missing values are plotted on the x-axis}
41
  
42
  \item{RangeSelector}{(optional) [boolean] add a range selector to the bottom of the chart that allows users to pan and zoom to various date ranges (see \code{\link[dygraphs]{dyRangeSelector}})}
43
  
44
  \item{Roller}{(optional) [numeric] number of time scale units (e.g. days, months, years) to average values over (see \code{\link[dygraphs]{dyRoller}})}
unknown's avatar
unknown committed
45
   
46
  \item{LegendShow}{(optional) [character] when to display the legend. Specify \code{"always"} to always show the legend. Specify \code{"onmouseover"} to only display it when a user mouses over the chart. Specify \code{"follow"} (default) to have the legend show as overlay to the chart which follows the mouse. See \code{\link[dygraphs]{dyLegend}}}   
unknown's avatar
unknown committed
47
48
  
  \item{...}{other parameters to be passed through to plotting functions}
unknown's avatar
unknown committed
49
50
51
52
}


\seealso{
53
\code{\link{PrepGR}}, \code{\link{CalGR}}, \code{\link{SimGR}}
unknown's avatar
unknown committed
54
55
56
57
58
59
60
}


\author{Olivier Delaigue}


\examples{
61
library(airGRteaching)
unknown's avatar
unknown committed
62
63

## data.frame of observed data
64
data(L0123001, package = "airGR")
unknown's avatar
unknown committed
65
66
67
BasinObs2 <- BasinObs[, c("DatesR", "P", "E", "Qmm", "T")]

## Preparation of observed data for modelling
68
PREP <- PrepGR(ObsDF = BasinObs2, HydroModel = "GR4J", CemaNeige = FALSE)
69
\donttest{dyplot(PREP, main = "Observation")}
unknown's avatar
unknown committed
70
71

## Calibration step
72
CAL <- CalGR(PrepGR = PREP, CalCrit = "KGE2",
73
             WupPer = NULL, CalPer = c("1990-01-01", "1993-12-31"))
74
\donttest{dyplot(CAL, main = "Calibration")}
unknown's avatar
unknown committed
75
76

## Simulation
77
SIM <- SimGR(PrepGR = PREP, CalGR = CAL, EffCrit = "KGE2",
78
             WupPer = NULL, SimPer = c("1994-01-01", "1998-12-31"))
79
\donttest{dyplot(SIM, main = "Simulation")}
unknown's avatar
unknown committed
80
}