IDF.agg.Rd 2.18 KB
Newer Older
Christoph Ritschel's avatar
Christoph Ritschel committed
1
% Generated by roxygen2: do not edit by hand
Rust Henning's avatar
Rust Henning committed
2
3
4
% Please edit documentation in R/IDF.R
\name{IDF.agg}
\alias{IDF.agg}
5
\title{Aggregation and annual maxima for choosen durations}
Rust Henning's avatar
Rust Henning committed
6
\usage{
Jana Ulrich's avatar
Jana Ulrich committed
7
8
IDF.agg(data, ds, na.accept = 0, which.stations = NULL,
  which.mon = 0:11, names = c("date", "RR"), cl = NULL)
Rust Henning's avatar
Rust Henning committed
9
10
}
\arguments{
11
12
13
14
\item{data}{list of data.frames containing time series for every station. 
The data.frame must have the columns 'date' and 'RR' unless onther names 
are specified in the parameter `names`. The column 'date' must contain strings with 
standard date format.}
Rust Henning's avatar
Rust Henning committed
15

16
17
\item{ds}{numeric vector of aggregation durations. 
(Must be multiples of time resolution at all stations.)}
Christoph Ritschel's avatar
Christoph Ritschel committed
18

Jana Ulrich's avatar
Jana Ulrich committed
19
20
\item{na.accept}{numeric giving maximum number of missing values for which annual max. should still be calculated}

21
22
\item{which.stations}{optional, subset of stations. Either numeric vector or character vector 
containing names of elements in data. If not given, all elements in `data` will be used.}
Christoph Ritschel's avatar
Christoph Ritschel committed
23

24
\item{which.mon}{optional, subset of months of which to calculate the annual maxima from.}
Christoph Ritschel's avatar
Christoph Ritschel committed
25

26
\item{names}{optional, character vector of length 2, containing the names of the columns to be used.}
Christoph Ritschel's avatar
Christoph Ritschel committed
27

28
29
30
\item{cl}{optional, number of cores to be used from \code{\link[pbapply]{pblapply}} for parallelization.}
}
\value{
Jana Ulrich's avatar
Jana Ulrich committed
31
data.frame containing the annual intensity maxima [mm/h] in `$xdat`, the corresponding duration in `$ds` 
32
and the station id or name in `$station`.
Rust Henning's avatar
Rust Henning committed
33
34
}
\description{
35
36
37
38
39
40
41
42
Aggregates several time series for chosen durations and finds annual maxima 
(either for the whole year or chosen months). Returns data.frame that can be used for
the function \code{\link{gev.d.fit}}.
}
\details{
If data contains stations with different time resolutions that need to be aggregated at
different durations, IDF.agg needs to be run seperately for the different groups of stations. 
Afterwards he results can be joint together using `rbind`.
Rust Henning's avatar
Rust Henning committed
43
}
Christoph Ritschel's avatar
Christoph Ritschel committed
44
\examples{
45
46
47
48
49
50
51
52
53
54
dates <- as.Date("2019-01-01")+0:729
x <- rgamma(n = 730, shape = 0.4, rate = 0.5)
df <- data.frame(date=dates,RR=x)
IDF.agg(list(df),ds=c(24,48))

##        xdat ds station
## 1 0.3025660 24       1
## 2 0.4112304 24       1
## 3 0.1650978 48       1
## 4 0.2356849 48       1
Rust Henning's avatar
Rust Henning committed
55
}
56
57
\seealso{
\code{\link{pgev.d}}
Rust Henning's avatar
Rust Henning committed
58
}