dwi(x, ...)## S3 method for class 'default':
dwi(x, out.unit = "years", from = start(x), to = end(x),
date.fmt = "%Y-%m-%d", tstep="days", ...)
## S3 method for class 'zoo':
dwi(x, out.unit = "years", from = start(x), to = end(x),
date.fmt = "%Y-%m-%d", tstep="days", ...)
## S3 method for class 'data.frame':
dwi(x, out.unit = "years", from, to, date.fmt = "\%Y-\%m-\%d", tstep="days",
dates = 1, verbose = TRUE, ...)
## S3 method for class 'matrix':
dwi(x, out.unit = "years", from, to, date.fmt = "\%Y-\%m-\%d", tstep="days",
dates = 1, verbose = TRUE, ...)
x
represent the time series measured in each gdate.fmt
.
When x
is a data.frame and this value is not provided, the date corresponding to the first row of x
is usdate.fmt
.
When x
is a data.frame and this value is not provided, the date corresponding to the last row of x
is usedformat
in as.Date
.
ONLY required when class(dates)=="factor"
ox
. Valid values are: days, months, years.
Since the version 0.3-0 of hydroTSM, this argument is not required any more, because it is not used any longer.x
If dates
is a number, it indicates the index of the column in x
that stores the dates
If dates
is a factor, it is cmatrixplot
## Loading the SanMartino precipitation data
data(SanMartinoPPts)
x <- SanMartinoPPts
## Days with information per year
dwi(x)
## Days with information per month per year.
dwi(x, out.unit="mpy")
###########
## Loading the monthly time series of precipitation within the Ebro River basin.
data(EbroPPtsMonthly)
## Months with information per year in the 9 first stations of 'EbroPPtsMonthly'
a <- dwi(EbroPPtsMonthly[,1:10], out.unit="years", dates=1)
## Before plotting the results in 'a', and just for obtaining a more interesting
## plot, 70 random numbers (between 1 and 11) are introduced in 'a'
a[sample(length(a), size = 70)] <- rep(1:11, length=70)
## Plotting the amount of months with information per year in each station
matrixplot(a, var.type="Days", main="Number of months with info per year")
Run the code above in your browser using DataLab