dwi | R Documentation |
This function generates a table indicating the number of days with information (<>NA) within a zoo object, aggregated by year, month or month per year.
dwi(x, ...)
## Default S3 method:
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 |
zoo, data.frame or matrix object, with daily/monthly/annual time series. |
out.unit |
aggregation time for the computation of the amount of days with information. Valid values are: |
from |
Character indicating the starting date for the computations. It has to be in the format indicated by |
to |
Character indicating the ending date for the computations. It has to be in the format indicated by |
date.fmt |
character indicating the format in which the dates are stored in dates, e.g. %Y-%m-%d. See |
tstep |
Time step used for storing the values in |
dates |
numeric, factor or Date object indicating how to obtain the dates for each column of |
verbose |
logical; if TRUE, progress messages are printed |
... |
further arguments passed to or from other methods. |
Mauricio Zambrano-Bigiarini, mzb.devel@gmail
matrixplot
## Loading the SanMartino precipitation data
data(SanMartinoPPts)
x <- SanMartinoPPts
## Not run:
## Days with information per year
dwi(x)
## Days with information per month per year.
dwi(x, out.unit="mpy")
## End(Not run)
###########
## Not run:
## 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")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.