IDF.agg.Rd 2.67 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 chosen durations}
Rust Henning's avatar
Rust Henning committed
6
\usage{
Laura Mack's avatar
typos    
Laura Mack committed
7
8
9
10
11
IDF.agg(
  data,
  ds,
  na.accept = 0,
  which.stations = NULL,
12
  which.mon = list(0:11),
Laura Mack's avatar
typos    
Laura Mack committed
13
  names = c("date", "RR"),
Jana Ulrich's avatar
Jana Ulrich committed
14
  cl = 1
Laura Mack's avatar
typos    
Laura Mack committed
15
)
Rust Henning's avatar
Rust Henning committed
16
17
}
\arguments{
18
\item{data}{list of data.frames containing time series for every station. 
Laura Mack's avatar
typos    
Laura Mack committed
19
The data.frame must have the columns 'date' and 'RR' unless other names 
20
21
are specified in the parameter `names`. The column 'date' must contain strings with 
standard date format.}
Rust Henning's avatar
Rust Henning committed
22

Jana Ulrich's avatar
Jana Ulrich committed
23
\item{ds}{numeric vector of aggregation durations in hours. 
24
(Must be multiples of time resolution at all stations.)}
Christoph Ritschel's avatar
Christoph Ritschel committed
25

26
27
\item{na.accept}{numeric in [0,1) giving maximum percentage of missing values 
for which block max. should still be calculated.}
Jana Ulrich's avatar
Jana Ulrich committed
28

29
30
\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
31

32
\item{which.mon}{optional, subset of months (as list containing values from 0 to 11) of which to calculate the annual maxima from.}
Christoph Ritschel's avatar
Christoph Ritschel committed
33

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

Jana Ulrich's avatar
Jana Ulrich committed
36
\item{cl}{optional, number of cores to be used from \code{\link[parallel]{parLapply}} for parallel computing.}
37
38
}
\value{
39
40
data.frame containing the annual intensity maxima [mm/h] in `$xdat`, the corresponding duration in `$ds`,
the `$year` and month (`$mon`) in which the maxima occured 
41
and the station id or name in `$station`.
Rust Henning's avatar
Rust Henning committed
42
43
}
\description{
44
45
46
47
48
49
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
Laura Mack's avatar
typos    
Laura Mack committed
50
51
different durations, IDF.agg needs to be run separately for the different groups of stations. 
Afterwards the results can be joint together using `rbind`.
Rust Henning's avatar
Rust Henning committed
52
}
Christoph Ritschel's avatar
Christoph Ritschel committed
53
\examples{
54
55
56
57
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)

58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# get annual maxima
IDF.agg(list('Sample'= df),ds=c(24,48),na.accept = 0.01)

##      xdat ds year  mon station
## 0.2853811 24 2019 0:11  Sample
## 0.5673122 24 2020 0:11  Sample
## 0.1598448 48 2019 0:11  Sample
## 0.3112713 48 2020 0:11  Sample

# get monthly maxima for each month of june, july and august
IDF.agg(list('Sample'=df),ds=c(24,48),na.accept = 0.01,which.mon = list(5,6,7))

# get maxima for time range from june to august
IDF.agg(list('Sample'=df),ds=c(24,48),na.accept = 0.01,which.mon = list(5:7))

Rust Henning's avatar
Rust Henning committed
73
}
74
75
\seealso{
\code{\link{pgev.d}}
Rust Henning's avatar
Rust Henning committed
76
}