Description Usage Arguments Author(s) Examples
Given a daily time series (usually precipitation), this function computes the average amount of wet/dry days in each month.
1 2 3 4 5 6 7 8 9 10 11 12 | dwdays(x, ...)
## Default S3 method:
dwdays(x, thr=0, type="wet", na.rm=TRUE, ... )
## S3 method for class 'data.frame'
dwdays(x, thr=0, type="wet", na.rm=TRUE,
dates=1, date.fmt="%Y-%m-%d", verbose=TRUE,...)
## S3 method for class 'matrix'
dwdays(x, thr=0, type="wet", na.rm=TRUE,
dates=1, date.fmt="%Y-%m-%d", verbose=TRUE,...)
|
x |
zoo, data.frame or matrix object, usually with daily time series of precipitation. |
thr |
numeric. Value of daily precipitation used as threshold for classifying a day as dry/wet or not. Days with a precipitation value larger to |
type |
character, indicating if the daily values have to be classified as dry or wet days. It works linked to the values specified in |
na.rm |
Logical. Should missing values be removed before counting? |
dates |
numeric, factor or Date object indicating how to obtain the dates |
date.fmt |
character indicating the format in which the dates are stored in dates, e.g. %Y-%m-%d. See |
verbose |
logical; if TRUE, progress messages are printed |
... |
further arguments passed to or from other methods. |
Mauricio Zambrano-Bigiarini, mzb.devel@gmail
1 2 3 4 5 6 7 | ## Loading the SanMartino precipitation data
data(SanMartinoPPts)
x <- SanMartinoPPts
## Average amount of wet days in each month (for this example, this means days
## with precipitation larger than 0.1mm)
dwdays(x, thr=0.1)
|
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
Loading required package: xts
Jan Feb Mar Apr May Jun Jul Aug
7.271429 7.471429 10.128571 13.600000 17.928571 18.185714 16.228571 15.414286
Sep Oct Nov Dec
13.500000 12.600000 11.057143 8.442857
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.