hydroplot
: When x
is a zoo object it plots (a maximum of) 9 graphs (lines plot, boxplots and/or histograms) of the daily, monthly, annual and/or seasonal time series.
sname2plot
: When x
is a data frame whose columns contain the time series of several gauging stations, it takes the name of one gauging station and plots the graphs described above.hydroplot(x, FUN, na.rm=TRUE, ptype="ts+boxplot+hist", pfreq="dma",
var.type, var.unit="units", main=NULL, xlab="Time", ylab,
win.len1=0, win.len2=0, tick.tstep="auto", lab.tstep="auto",
lab.fmt=NULL, cex=0.3, cex.main=1.3, cex.lab=1.3, cex.axis=1.3,
col=c("blue", "lightblue", "lightblue"),
from, to, date.fmt= "%Y-%m-%d", stype="default", h=NULL, ...)sname2plot(x, sname, FUN, na.rm=TRUE, ptype="ts+boxplot+hist", pfreq="dma",
var.type, var.unit="units",main=NULL, xlab="Time", ylab=NULL,
win.len1=0, win.len2=0, tick.tstep="auto", lab.tstep="auto",
lab.fmt=NULL, cex=0.3, cex.main=1.3, cex.lab=1.3, cex.axis=1.3,
col=c("blue", "lightblue", "lightblue"),
dates, date.fmt = "%Y-%m-%d", from, to, stype="default", h=NULL )
x
is a data frame.
Character representing the name of a station, which have to correspond to one column name in x
var.type
is missing AND pfreq != "o"
.
Function that have to be applied for transforming from daily to monthly or annual time step (e.g., For precipitation FUN=sum
and for temperature and flow ts, FUN
is missing.
character representing the type of variable being plotted. Used for determining the function used for computing the monthly and annual values when FUN
is missing. Valid values are:
-) Premain= paste(var.type, "at", sname, sep="")
,plot
.plot
.format
in as.Date
. If not specified, it will try "%Y-%m-%d" when lab.tstep=="days"
, par
).cex
(See par
).cex
(See par
).cex
(See par
).pfreq="o"
, only one character element is needed.
See
x
is a data frame. It is a numeric, factor or Date object indicating how to obtain the dates corresponding to the sname
station.
If dates
is a number, it indicates the index of the column in format
in as.Date
.
ONLY required when class(dates)=="factor"
date.fmt
.date.fmt
.pfreq=seasonal
.
character, indicating which weather seasons will be used for computing the output. Possible values are:
-) default => "winter"= Dec, Jan, Feb; "spring"= Mar, Apr, May; "sumpfreq=seasonal
, for plotting horizontal lines in each seasonal plot.
numeric, with 1 or 4 elements, with the value used for plotting an horizontal line in each seasonal plot, in the following order: winter (DJF), sprplot.zoo
and axis
functions or from other methods.pfreq
, daily, monthly, annual and/or seasonal time series plots, boxplots and histograms are produced.
Depending on the value of ptype
, time series plots, boxplots and/or histograms are produced.sname2ts
#############
## Loading daily streamflows at the station Oca en Ona (Ebro River basin, Spain) ##
data(OcaEnOnaQts)
## 3 ts, 3 boxplots and 3 histograms
hydroplot(OcaEnOnaQts, FUN=mean, ylab= "Q", var.unit = "m3/s")
## only the original time series
hydroplot(OcaEnOnaQts, pfreq="o")
## only the year 1962 of the original time series
hydroplot(OcaEnOnaQts, pfreq="o", from="1962-01-01", to="1962-12-31")
## seasonal plots
hydroplot(OcaEnOnaQts, pfreq="seasonal", FUN=mean, stype="default")
#############
## Loading the monthly time series of precipitation within the Ebro River basin.
data(EbroPPtsMonthly)
## Plotting the monthly and annual values of precipitation at station "P9001",
## stored in 'EbroPPtsMonthly'.
sname2plot(EbroPPtsMonthly, sname="P9001", var.type="Precipitation", dates=1, pfreq="ma")
## Plotting seasonal precipitation at station "P9001"
sname2plot(EbroPPtsMonthly, sname="P9001", FUN=sum, dates=1, pfreq="seasonal", stype="default")
Run the code above in your browser using DataLab