diff --git a/DESCRIPTION b/DESCRIPTION index 7f1b169..6feddce 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: kostra2010R Title: R Interface for KOSTRA-DWD-2010R Dataset -Version: 0.12.0 +Version: 0.12.1 Date: 2024-03-06 Authors@R: person("Dimitri", "Falk", , "falk.dimitri@eglv.de", role = c("aut", "cre")) diff --git a/NEWS.md b/NEWS.md index 4da2c35..70b8f77 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# version 0.12.0 +# version 0.12.1 ## features diff --git a/R/calc_designstorm.R b/R/calc_designstorm.R index 5f0337f..cebe8ab 100644 --- a/R/calc_designstorm.R +++ b/R/calc_designstorm.R @@ -14,9 +14,9 @@ #' @seealso [get_stats()] #' #' @examples -#' kostra <- get_stats("49011") +#' stats <- get_stats("42016") #' -#' calc_designstorm(kostra, d = 60, tn = 20, type = "EulerII") +#' calc_designstorm(stats, d = 60, tn = 20, type = "EulerII") calc_designstorm <- function(x = NULL, d = NULL, tn = NULL, @@ -24,7 +24,7 @@ calc_designstorm <- function(x = NULL, # debugging ------------------------------------------------------------------ - # x <- kostra + # x <- get_stats("42016") # d <- 60 # tn <- 20 # type <- "EulerII" diff --git a/R/calc_pen.R b/R/calc_pen.R index 53545dd..759d2f2 100644 --- a/R/calc_pen.R +++ b/R/calc_pen.R @@ -14,14 +14,14 @@ #' Verworn & Draschoff (2008): PEN-Erweiterung. #' #' @examples -#' kostra <- get_stats("49011") +#' stats <- get_stats("42016") #' -#' calc_pen(kostra) +#' calc_pen(stats) calc_pen <- function(x = NULL) { # debugging ------------------------------------------------------------------ - # x <- get_stats("49011") + # x <- get_stats("42016") # check arguments ------------------------------------------------------------ diff --git a/R/get_centroid.R b/R/get_centroid.R index 3af8097..83fffcc 100644 --- a/R/get_centroid.R +++ b/R/get_centroid.R @@ -12,7 +12,7 @@ #' get_centroid(c(6.09, 50.46), crs = "epsg:4326") #' get_centroid(c(367773, 5703579), crs = "epsg:25832") #' -#' get_centroid("52070") +#' get_centroid("40477") #' get_centroid("Freiburg im Breisgau") #' get_centroid("Kronprinzenstr. 24, 45128 Essen") get_centroid <- function(x = NULL, @@ -24,7 +24,7 @@ get_centroid <- function(x = NULL, # x <- c(367773, 5703579) # crs <- "epsg:4326" - # x <- "52070" + # x <- "40477" # x <- "Freiburg im Breisgau" # x <- "Kronprinzenstr. 24, 45128 Essen" diff --git a/R/get_depth.R b/R/get_depth.R index 53057c1..8b40381 100644 --- a/R/get_depth.R +++ b/R/get_depth.R @@ -17,10 +17,10 @@ #' Starkniederschlagshöhen für Deutschland (Bezugszeitraum 1951 bis 2010). #' #' @examples -#' kostra <- get_stats("49011") +#' stats <- get_stats("42016") #' -#' get_depth(kostra, d = 60, tn = 50) -#' get_depth(kostra, d = 60, tn = 50, uc = TRUE) +#' get_depth(stats, d = 60, tn = 50) +#' get_depth(stats, d = 60, tn = 50, uc = TRUE) get_depth <- function(x = NULL, d = NULL, tn = NULL, @@ -28,7 +28,7 @@ get_depth <- function(x = NULL, # debugging ------------------------------------------------------------------ - # x <- get_stats("49011") + # x <- get_stats("42016") # d <- 60 # tn <- 50 # uc <- TRUE diff --git a/R/get_idx.R b/R/get_idx.R index 4eb113b..a03f14e 100644 --- a/R/get_idx.R +++ b/R/get_idx.R @@ -8,14 +8,14 @@ #' @seealso [get_centroid()] #' #' @examples -#' p <- get_centroid(c(367773, 5703579), crs = "epsg:25832") +#' p <- get_centroid(c(406658, 5761320), crs = "epsg:25832") #' #' get_idx(p) get_idx <- function(x = NULL) { # debugging ------------------------------------------------------------------ - # x <- c(367773, 5703579) + # x <- get_centroid(c(406658, 5761320), crs = "epsg:25832") # check arguments ------------------------------------------------------------ diff --git a/R/get_returnp.R b/R/get_returnp.R index c1690df..5937d92 100644 --- a/R/get_returnp.R +++ b/R/get_returnp.R @@ -15,10 +15,10 @@ #' @seealso [get_stats()] #' #' @examples -#' kostra <- get_stats("49011") +#' stats <- get_stats("42016") #' -#' get_returnp(kostra, hn = 69.3, d = 1440) -#' get_returnp(kostra, hn = 69.3, d = 1440, interpolate = TRUE) +#' get_returnp(stats, hn = 69.3, d = 1440) +#' get_returnp(stats, hn = 69.3, d = 1440, interpolate = TRUE) get_returnp <- function(x = NULL, hn = NULL, d = NULL, diff --git a/R/get_stats.R b/R/get_stats.R index 64bd228..3b2574c 100644 --- a/R/get_stats.R +++ b/R/get_stats.R @@ -11,14 +11,14 @@ #' @seealso [idx_build()] #' #' @examples -#' get_stats("49011") -#' get_stats("49011", as_depth = FALSE) +#' get_stats("42016") +#' get_stats("42016", as_depth = FALSE) get_stats <- function(x = NULL, as_depth = TRUE) { # debugging ------------------------------------------------------------------ - # x <- "49011" + # x <- "42016" # as_depth <- FALSE # check arguments ------------------------------------------------------------ diff --git a/R/idx_build.R b/R/idx_build.R index 3d95d9a..160087e 100644 --- a/R/idx_build.R +++ b/R/idx_build.R @@ -9,14 +9,14 @@ #' @seealso [idx_decompose()] #' #' @examples -#' idx_build(row = 49, col = 11) +#' idx_build(row = 42, col = 16) idx_build <- function(row = NULL, col = NULL) { # debugging ------------------------------------------------------------------ - # row <- 49 - # col <- 11 + # row <- 42 + # col <- 16 # check arguments ------------------------------------------------------------ diff --git a/R/idx_decompose.R b/R/idx_decompose.R index f08c09f..63a68fc 100644 --- a/R/idx_decompose.R +++ b/R/idx_decompose.R @@ -8,12 +8,12 @@ #' @seealso [idx_build()] #' #' @examples -#' idx_decompose(x = "49011") +#' idx_decompose(x = "42016") idx_decompose <- function(x = NULL) { # debugging ------------------------------------------------------------------ - # x = "49011" + # x = "42016" # check arguments ------------------------------------------------------------ diff --git a/R/idx_exists.R b/R/idx_exists.R index d6fbbc2..08851ea 100644 --- a/R/idx_exists.R +++ b/R/idx_exists.R @@ -6,12 +6,12 @@ #' @export #' #' @examples -#' idx_exists("49011") +#' idx_exists("42016") idx_exists <- function(x = NULL) { # debugging ------------------------------------------------------------------ - # x <- "49011" + # x <- "42016" # check arguments ------------------------------------------------------------ diff --git a/R/plot_idf.R b/R/plot_idf.R index 1401f59..4899884 100644 --- a/R/plot_idf.R +++ b/R/plot_idf.R @@ -11,19 +11,19 @@ #' @seealso [get_stats()] #' #' @examples -#' get_stats("49011") |> plot_idf() +#' get_stats("42016") |> plot_idf() #' -#' get_stats("49011") |> plot_idf(tn = 100) +#' get_stats("42016") |> plot_idf(tn = 100) #' -#' get_stats("49011") |> plot_idf(log10 = TRUE) +#' get_stats("42016") |> plot_idf(log10 = TRUE) plot_idf <- function(x = NULL, tn = NULL, log10 = FALSE) { # debugging ------------------------------------------------------------------ - # x <- get_stats("49011") - # x <- get_stats("49011", as_depth = FALSE) + # x <- get_stats("42016") + # x <- get_stats("42016", as_depth = FALSE) # tn <- 100 diff --git a/R/view_spatial.R b/R/view_spatial.R index bc04f4b..5da09d3 100644 --- a/R/view_spatial.R +++ b/R/view_spatial.R @@ -12,16 +12,16 @@ #' \dontrun{ #' view_spatial() #' -#' view_spatial("49011") -#' view_spatial("49011", file = "kostra2010R_49011.png") +#' view_spatial("42016") +#' view_spatial("42016", file = "kostra2010R_42016.png") #' } view_spatial <- function(x = NULL, file = NULL) { # debugging ------------------------------------------------------------------ - # x <- "49011" - # file <- "kostra2010R_49011.png" + # x <- "42016" + # file <- "kostra2010R_42016.png" # check arguments ------------------------------------------------------------ diff --git a/R/write_stats.R b/R/write_stats.R index 0a6f0ee..fe294dc 100644 --- a/R/write_stats.R +++ b/R/write_stats.R @@ -10,18 +10,18 @@ #' #' @examples #' \dontrun{ -#' kostra <- get_stats("49011") +#' stats <- get_stats("42016") #' -#' write_stats(kostra) -#' write_stats(kostra, file = "kostra2010R_hN_49011.csv") +#' write_stats(stats) +#' write_stats(stats, file = "kostra2010R_hN_42016.csv") #' } write_stats <- function(x = NULL, file = NULL) { # debugging ------------------------------------------------------------------ - # x <- get_stats("49011") - # file <- "kostra2010R_hN_49011.csv" + # x <- get_stats("42016") + # file <- "kostra2010R_hN_42016.csv" # check arguments ------------------------------------------------------------ diff --git a/README.Rmd b/README.Rmd index b3b00a0..30e27a4 100644 --- a/README.Rmd +++ b/README.Rmd @@ -54,14 +54,14 @@ Sometimes identification of grid cells is not accomplished using "INDEX_RC" dire ```{r} # Generate "INDEX_RC" based on row and column information. -idx_build(row = 49, col = 11) +idx_build(row = 42, col = 16) ``` If you wanted to check whether this constructed "INDEX_RC" field is really present in the dataset (or you found an ID in some report and are not sure, if it is still being used), make use of the following function. ```{r} # Is the following "INDEX_RC" entry present in the dataset? -idx_exists("49011") +idx_exists("42016") ``` ### Get "INDEX_RC" based on spatial information @@ -109,18 +109,18 @@ Now that we have messed a little with the grid cell identifiers, let's get a sne ```{r} # Build a tibble containing statistical precipitation depths as a function of # duration and return periods for the grid cell specified. -kostra <- get_stats("49011") +stats <- get_stats("42016") -kostra +stats ``` Some describing attributes have been assigned to the tibble. ```{r} -attr(kostra, "id") -attr(kostra, "period") -attr(kostra, "returnperiods_a") -attr(kostra, "source") +attr(stats, "id") +attr(stats, "period") +attr(stats, "returnperiods_a") +attr(stats, "source") ``` ### Get precipitation depths, calculate precipitation yield @@ -130,14 +130,14 @@ If we now wanted to know the statistical precipitation depth e.g. for an event o ```{r} # So we are interested in the rainfall amount [mm] for an event lasting 240 min # with a return period of 100 a. -get_depth(kostra, d = 240, tn = 100) +get_depth(stats, d = 240, tn = 100) ``` In order to respect statistical uncertainties, as proposed in Malitz & Ertel (2015), ranging between 10 % and 20 % as a function of the chosen return period, make use of `uc = TRUE` to get an interval centered around the single value above. ```{r} # Same data, but with uncertainties considered. -get_depth(kostra, d = 240, tn = 100, uc = TRUE) +get_depth(stats, d = 240, tn = 100, uc = TRUE) ``` If you need precipitation yield values [l/(s\*ha)] instead of precipitation depth [mm] or vice versa, make use of the following helper function. @@ -153,8 +153,8 @@ as_depth(43.1, d = 240) Finally, we want to determine the return period according to the dataset for a precipitation depth and duration given. ```{r} -# Let's assume we measured 72.3 mm in 24 h. -get_returnp(kostra, hn = 72.3, d = 1440) +# Let's assume we measured 75.2 mm in 24 h. +get_returnp(stats, hn = 75.2, d = 1440) ``` Accordingly, the approximate corresponding recurrence interval resp. annuality of this event amounts to something between 30 and 50 years as per KOSTRA-DWD-2010R. @@ -163,17 +163,17 @@ The following edge cases are to be mentioned: ```{r} # 1) In case a class boundary is hit, the return period is replicated. -get_returnp(kostra, hn = 42.8, d = 1440) +get_returnp(stats, hn = 38.2, d = 1440) ``` ```{r} # 2) In case the return period tn is smaller than 1, interval opens with 0. -get_returnp(kostra, hn = 30.2, d = 1440) +get_returnp(stats, hn = 26.4, d = 1440) ``` ```{r} # 3) In case the return period tn is larger than 100, interval closes with Inf. -get_returnp(kostra, hn = 86.3, d = 1440) +get_returnp(stats, hn = 92.8, d = 1440) ``` ### Return period interpolation @@ -182,7 +182,7 @@ Although it may be somewhat questionable from a scientific perspective, you migh ```{r} # Using the same example as above, previously resulting in 30 a < tn < 50 a. -get_returnp(kostra, hn = 72.3, d = 1440, interpolate = TRUE) +get_returnp(stats, hn = 75.2, d = 1440, interpolate = TRUE) ``` ### Return period extrapolation @@ -191,7 +191,7 @@ Since KOSTRA-DWD-2010R has an upper limit of Tn = 100 a, we can make use of e.g. ```{r} # Output in a separate tibble to not mix up applied methods. -pen <- calc_pen(kostra) +pen <- calc_pen(stats) pen ``` @@ -208,7 +208,7 @@ Furthermore, statistical precipitation depths can be used to create design storm ```{r, warning = FALSE} # Euler Type II design storm with a duration of 60 minutes and a return period of 100 a. -xts <- calc_designstorm(kostra, d = 60, tn = 100, type = "EulerII") +xts <- calc_designstorm(stats, d = 60, tn = 100, type = "EulerII") xts ``` @@ -218,7 +218,7 @@ xts Data can additionally be visualized as intensity-duration-frequency curves using `plot_idf()`, underpinned by `{ggplot2}` ... ```{r, fig.width = 9} -plot_idf(kostra, log10 = TRUE) +plot_idf(stats, log10 = TRUE) ``` ... or exported to disk using `write_stats()` based on `write.table()`. diff --git a/README.md b/README.md index 4a8139f..d0e8679 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ and load the package via ``` r library(kostra2010R) -#> 0.11.3 +#> 0.12.1 ``` ## Getting started @@ -62,8 +62,8 @@ used to generate the necessary “INDEX_RC” field. ``` r # Generate "INDEX_RC" based on row and column information. -idx_build(row = 49, col = 11) -#> [1] "49011" +idx_build(row = 42, col = 16) +#> [1] "42016" ``` If you wanted to check whether this constructed “INDEX_RC” field is @@ -73,7 +73,7 @@ function. ``` r # Is the following "INDEX_RC" entry present in the dataset? -idx_exists("49011") +idx_exists("42016") #> [1] TRUE ``` @@ -115,9 +115,9 @@ p3 #> Geometry set for 1 feature #> Geometry type: POINT #> Dimension: XY -#> Bounding box: xmin: 6.784486 ymin: 51.23912 xmax: 6.784486 ymax: 51.23912 +#> Bounding box: xmin: 6.784487 ymin: 51.23912 xmax: 6.784487 ymax: 51.23912 #> Geodetic CRS: WGS 84 -#> POINT (6.784486 51.23912) +#> POINT (6.784487 51.23912) p4 <- get_centroid("Freiburg im Breisgau") p4 @@ -164,43 +164,43 @@ specified. ``` r # Build a tibble containing statistical precipitation depths as a function of # duration and return periods for the grid cell specified. -kostra <- get_stats("49011") +stats <- get_stats("42016") -kostra +stats #> # A tibble: 18 × 12 #> D_min D_hour D_day HN_001A HN_002A HN_003A HN_005A HN_010A HN_020A HN_030A #> -#> 1 5 NA NA 5.6 6.9 7.7 8.7 10 11.3 12.1 -#> 2 10 NA NA 8.6 10.6 11.7 13.1 15.1 17.1 18.2 -#> 3 15 NA NA 10.5 13 14.4 16.2 18.6 21.1 22.5 -#> 4 20 NA NA 11.8 14.7 16.4 18.5 21.4 24.3 25.9 -#> 5 30 NA NA 13.5 17.1 19.2 21.9 25.5 29.1 31.2 -#> 6 45 NA NA 14.9 19.4 22.1 25.4 29.9 34.4 37.1 -#> 7 60 1 NA 15.7 21 24.1 28 33.3 38.7 41.8 -#> 8 90 1.5 NA 17.4 22.9 26.2 30.2 35.7 41.2 44.4 -#> 9 120 2 NA 18.8 24.4 27.7 31.9 37.5 43.1 46.4 -#> 10 180 3 NA 20.9 26.7 30.1 34.4 40.2 46 49.4 -#> 11 240 4 NA 22.5 28.5 32 36.4 42.3 48.3 51.8 -#> 12 360 6 NA 25 31.2 34.8 39.3 45.5 51.7 55.3 -#> 13 540 9 NA 27.8 34.2 37.9 42.6 49 55.3 59.1 -#> 14 720 12 NA 30 36.5 40.3 45.1 51.6 58.2 62 -#> 15 1080 18 NA 33.3 40.1 44 49 55.7 62.5 66.4 -#> 16 1440 24 1 35.9 42.8 46.8 51.9 58.8 65.8 69.8 -#> 17 2880 48 2 44.1 52.2 57 62.9 71 79.1 83.8 -#> 18 4320 72 3 49.8 58.6 63.7 70.2 79 87.7 92.9 +#> 1 5 NA NA 4.9 6.6 7.6 8.9 10.6 12.3 13.3 +#> 2 10 NA NA 7.9 10.1 11.4 13.1 15.3 17.5 18.8 +#> 3 15 NA NA 9.8 12.4 14 15.9 18.5 21.1 22.7 +#> 4 20 NA NA 11.2 14.1 15.8 18 20.9 23.9 25.6 +#> 5 30 NA NA 13 16.4 18.4 21 24.4 27.9 29.9 +#> 6 45 NA NA 14.6 18.6 21 23.9 28 32 34.4 +#> 7 60 1 NA 15.5 20 22.7 26 30.6 35.1 37.7 +#> 8 90 1.5 NA 16.8 21.8 24.6 28.3 33.2 38.1 41 +#> 9 120 2 NA 17.8 23.1 26.1 30 35.2 40.5 43.5 +#> 10 180 3 NA 19.3 25 28.4 32.6 38.3 44 47.3 +#> 11 240 4 NA 20.5 26.6 30.1 34.6 40.6 46.7 50.2 +#> 12 360 6 NA 22.2 28.8 32.7 37.6 44.1 50.7 54.6 +#> 13 540 9 NA 24.1 31.3 35.5 40.8 48 55.2 59.4 +#> 14 720 12 NA 25.6 33.2 37.7 43.3 50.9 58.5 63 +#> 15 1080 18 NA 27.7 36 40.9 47 55.3 63.6 68.5 +#> 16 1440 24 1 29.4 38.2 43.4 49.9 58.7 67.5 72.7 +#> 17 2880 48 2 36.5 46.3 52 59.3 69.1 78.9 84.6 +#> 18 4320 72 3 41.4 51.8 57.9 65.5 75.9 86.3 92.4 #> # ℹ 2 more variables: HN_050A , HN_100A ``` Some describing attributes have been assigned to the tibble. ``` r -attr(kostra, "id") -#> [1] "49011" -attr(kostra, "period") +attr(stats, "id") +#> [1] "42016" +attr(stats, "period") #> [1] "1951-01-01 +01" "2010-12-31 +01" -attr(kostra, "returnperiods_a") +attr(stats, "returnperiods_a") #> [1] 1 2 3 5 10 20 30 50 100 -attr(kostra, "source") +attr(stats, "source") #> [1] "KOSTRA-DWD-2010R" ``` @@ -214,8 +214,8 @@ function helping you out. ``` r # So we are interested in the rainfall amount [mm] for an event lasting 240 min # with a return period of 100 a. -get_depth(kostra, d = 240, tn = 100) -#> 62.1 [mm] +get_depth(stats, d = 240, tn = 100) +#> 60.7 [mm] ``` In order to respect statistical uncertainties, as proposed in Malitz & @@ -225,9 +225,9 @@ around the single value above. ``` r # Same data, but with uncertainties considered. -get_depth(kostra, d = 240, tn = 100, uc = TRUE) +get_depth(stats, d = 240, tn = 100, uc = TRUE) #> Units: [mm] -#> [1] 49.7 74.5 +#> [1] 48.6 72.8 ``` If you need precipitation yield values \[l/(s\*ha)\] instead of @@ -248,8 +248,8 @@ Finally, we want to determine the return period according to the dataset for a precipitation depth and duration given. ``` r -# Let's assume we measured 72.3 mm in 24 h. -get_returnp(kostra, hn = 72.3, d = 1440) +# Let's assume we measured 75.2 mm in 24 h. +get_returnp(stats, hn = 75.2, d = 1440) #> Units: [a] #> [1] 30 50 ``` @@ -262,21 +262,21 @@ The following edge cases are to be mentioned: ``` r # 1) In case a class boundary is hit, the return period is replicated. -get_returnp(kostra, hn = 42.8, d = 1440) +get_returnp(stats, hn = 38.2, d = 1440) #> Units: [a] #> [1] 2 2 ``` ``` r # 2) In case the return period tn is smaller than 1, interval opens with 0. -get_returnp(kostra, hn = 30.2, d = 1440) +get_returnp(stats, hn = 26.4, d = 1440) #> Units: [a] #> [1] 0 1 ``` ``` r # 3) In case the return period tn is larger than 100, interval closes with Inf. -get_returnp(kostra, hn = 86.3, d = 1440) +get_returnp(stats, hn = 92.8, d = 1440) #> Units: [a] #> [1] 100 Inf ``` @@ -289,8 +289,8 @@ using linear interpolation between adjacent nodes: ``` r # Using the same example as above, previously resulting in 30 a < tn < 50 a. -get_returnp(kostra, hn = 72.3, d = 1440, interpolate = TRUE) -#> 39.9 [a] +get_returnp(stats, hn = 75.2, d = 1440, interpolate = TRUE) +#> 37.7 [a] ``` ### Return period extrapolation @@ -301,36 +301,36 @@ precipitation depths for all duration levels. ``` r # Output in a separate tibble to not mix up applied methods. -pen <- calc_pen(kostra) +pen <- calc_pen(stats) pen #> # A tibble: 18 × 9 #> D_min D_hour D_day HN_200A HN_500A HN_1000A HN_2000A HN_5000A HN_10000A #> -#> 1 5 NA NA 19.1 21.6 23.4 25.2 27.7 29.5 -#> 2 10 NA NA 28.7 32.3 35 37.7 41.4 44.1 -#> 3 15 NA NA 35.6 40.1 43.5 46.9 51.5 54.9 -#> 4 20 NA NA 41.1 46.3 50.3 54.3 59.6 63.5 -#> 5 30 NA NA 49.9 56.5 61.4 66.4 72.9 77.9 -#> 6 45 NA NA 60.1 68.2 74.3 80.4 88.5 94.6 -#> 7 60 1 NA 68.3 77.7 84.7 91.8 101. 108. -#> 8 90 1.5 NA 72.1 81.8 89.2 96.6 106. 114. -#> 9 120 2 NA 75 85.1 92.7 100. 110. 118 -#> 10 180 3 NA 79.5 89.9 97.9 106. 116. 124. -#> 11 240 4 NA 82.7 93.5 102. 110. 121. 129. -#> 12 360 6 NA 87.7 99 108. 116. 127. 136. -#> 13 540 9 NA 93 105. 114. 123. 134. 143. -#> 14 720 12 NA 97.1 109. 118. 128. 140. 149. -#> 15 1080 18 NA 103. 116 126. 135. 148. 158. -#> 16 1440 24 1 108. 121. 131. 141 154. 164 -#> 17 2880 48 2 129. 145. 156. 168. 184. 195. -#> 18 4320 72 3 142. 159. 172. 185. 202. 215. +#> 1 5 NA NA 21.7 24.7 27 29.2 32.2 34.5 +#> 2 10 NA NA 30.3 34.3 37.3 40.3 44.3 47.4 +#> 3 15 NA NA 36.2 41 44.5 48.1 52.9 56.5 +#> 4 20 NA NA 40.9 46.2 50.2 54.2 59.6 63.6 +#> 5 30 NA NA 47.8 54 58.8 63.5 69.7 74.5 +#> 6 45 NA NA 55.2 62.5 67.9 73.4 80.7 86.2 +#> 7 60 1 NA 60.9 69 75.1 81.2 89.4 95.5 +#> 8 90 1.5 NA 66.2 75 81.7 88.4 97.2 104. +#> 9 120 2 NA 70.2 79.6 86.7 93.8 103. 110. +#> 10 180 3 NA 76.4 86.6 94.3 102 112. 120. +#> 11 240 4 NA 81 91.8 100 108. 119 127. +#> 12 360 6 NA 88.3 100. 109 118. 130. 139. +#> 13 540 9 NA 95.9 109. 118. 128. 141. 151. +#> 14 720 12 NA 102. 115. 126. 136. 150. 160. +#> 15 1080 18 NA 111. 126. 137. 148 163. 174 +#> 16 1440 24 1 118. 133. 145. 157. 173. 185. +#> 17 2880 48 2 135. 153 166. 180. 198. 211 +#> 18 4320 72 3 147. 166. 180. 194. 213. 228. ``` ``` r # Former attribute names are preserved. attr(pen, "id") -#> [1] "49011" +#> [1] "42016" attr(pen, "returnperiods_a") #> [1] 200 500 1000 2000 5000 10000 ``` @@ -343,22 +343,22 @@ implemented. ``` r # Euler Type II design storm with a duration of 60 minutes and a return period of 100 a. -xts <- calc_designstorm(kostra, d = 60, tn = 100, type = "EulerII") +xts <- calc_designstorm(stats, d = 60, tn = 100, type = "EulerII") xts -#> [,1] -#> 2000-01-01 00:00:00 4.1 -#> 2000-01-01 00:05:00 5.2 -#> 2000-01-01 00:10:00 7.2 -#> 2000-01-01 00:15:00 14.4 -#> 2000-01-01 00:20:00 3.3 -#> 2000-01-01 00:25:00 3.3 -#> 2000-01-01 00:30:00 2.5 -#> 2000-01-01 00:35:00 2.5 -#> 2000-01-01 00:40:00 2.5 -#> 2000-01-01 00:45:00 2.0 -#> 2000-01-01 00:50:00 2.0 -#> 2000-01-01 00:55:00 2.0 +#> [,1] +#> 2000-01-01 00:00:00 3.50 +#> 2000-01-01 00:05:00 4.50 +#> 2000-01-01 00:10:00 6.50 +#> 2000-01-01 00:15:00 16.20 +#> 2000-01-01 00:20:00 2.60 +#> 2000-01-01 00:25:00 2.60 +#> 2000-01-01 00:30:00 1.83 +#> 2000-01-01 00:35:00 1.83 +#> 2000-01-01 00:40:00 1.83 +#> 2000-01-01 00:45:00 1.40 +#> 2000-01-01 00:50:00 1.40 +#> 2000-01-01 00:55:00 1.40 ``` ### Further utilization @@ -367,7 +367,7 @@ Data can additionally be visualized as intensity-duration-frequency curves using `plot_idf()`, underpinned by `{ggplot2}` … ``` r -plot_idf(kostra, log10 = TRUE) +plot_idf(stats, log10 = TRUE) ``` diff --git a/man/calc_designstorm.Rd b/man/calc_designstorm.Rd index 6709432..436a89a 100644 --- a/man/calc_designstorm.Rd +++ b/man/calc_designstorm.Rd @@ -23,9 +23,9 @@ An xts object. Design storm calculation based on statistical precipitation depths } \examples{ -kostra <- get_stats("49011") +stats <- get_stats("42016") -calc_designstorm(kostra, d = 60, tn = 20, type = "EulerII") +calc_designstorm(stats, d = 60, tn = 20, type = "EulerII") } \seealso{ \code{\link[=get_stats]{get_stats()}} diff --git a/man/calc_pen.Rd b/man/calc_pen.Rd index 063f2fa..c19d90d 100644 --- a/man/calc_pen.Rd +++ b/man/calc_pen.Rd @@ -18,9 +18,9 @@ duration and return periods. Extrapolation of precipitation depths for Tn > 100 a according to PEN-LAWA } \examples{ -kostra <- get_stats("49011") +stats <- get_stats("42016") -calc_pen(kostra) +calc_pen(stats) } \references{ Verworn & Kummer (2006): Praxisrelevante Extremwerte des Niederschlages (PEN).\cr diff --git a/man/figures/README-unnamed-chunk-21-1.png b/man/figures/README-unnamed-chunk-21-1.png index 192d5d9..ef4efb5 100644 Binary files a/man/figures/README-unnamed-chunk-21-1.png and b/man/figures/README-unnamed-chunk-21-1.png differ diff --git a/man/get_centroid.Rd b/man/get_centroid.Rd index f985bab..ccff360 100644 --- a/man/get_centroid.Rd +++ b/man/get_centroid.Rd @@ -23,7 +23,7 @@ Construct a geometry set object of type sfc_POINT based on user input get_centroid(c(6.09, 50.46), crs = "epsg:4326") get_centroid(c(367773, 5703579), crs = "epsg:25832") -get_centroid("52070") +get_centroid("40477") get_centroid("Freiburg im Breisgau") get_centroid("Kronprinzenstr. 24, 45128 Essen") } diff --git a/man/get_depth.Rd b/man/get_depth.Rd index 591679b..836396c 100644 --- a/man/get_depth.Rd +++ b/man/get_depth.Rd @@ -24,10 +24,10 @@ units. Precipitation depth \code{[mm]}. Get precipitation depth for a specified duration level and return period } \examples{ -kostra <- get_stats("49011") +stats <- get_stats("42016") -get_depth(kostra, d = 60, tn = 50) -get_depth(kostra, d = 60, tn = 50, uc = TRUE) +get_depth(stats, d = 60, tn = 50) +get_depth(stats, d = 60, tn = 50, uc = TRUE) } \references{ Malitz, G. & Ertel, H. (2015): KOSTRA-DWD-2010 - diff --git a/man/get_idx.Rd b/man/get_idx.Rd index c6f5525..92a43dc 100644 --- a/man/get_idx.Rd +++ b/man/get_idx.Rd @@ -16,7 +16,7 @@ character. Unique representation of the relevant "INDEX_RC" field. Get relevant "INDEX_RC" based on user-defined geometry } \examples{ -p <- get_centroid(c(367773, 5703579), crs = "epsg:25832") +p <- get_centroid(c(406658, 5761320), crs = "epsg:25832") get_idx(p) } diff --git a/man/get_returnp.Rd b/man/get_returnp.Rd index 362008c..1015f1c 100644 --- a/man/get_returnp.Rd +++ b/man/get_returnp.Rd @@ -26,10 +26,10 @@ Vector of length 1 with \code{interpolate = TRUE}. Get return period for specified duration level and precipitation depth } \examples{ -kostra <- get_stats("49011") +stats <- get_stats("42016") -get_returnp(kostra, hn = 69.3, d = 1440) -get_returnp(kostra, hn = 69.3, d = 1440, interpolate = TRUE) +get_returnp(stats, hn = 69.3, d = 1440) +get_returnp(stats, hn = 69.3, d = 1440, interpolate = TRUE) } \seealso{ \code{\link[=get_stats]{get_stats()}} diff --git a/man/get_stats.Rd b/man/get_stats.Rd index 91884ae..0519189 100644 --- a/man/get_stats.Rd +++ b/man/get_stats.Rd @@ -20,8 +20,8 @@ duration and return period for the KOSTRA-DWD-2010R grid cell specified. Get cell-specific statistics from KOSTRA-DWD-2010R dataset } \examples{ -get_stats("49011") -get_stats("49011", as_depth = FALSE) +get_stats("42016") +get_stats("42016", as_depth = FALSE) } \seealso{ \code{\link[=idx_build]{idx_build()}} diff --git a/man/idx_build.Rd b/man/idx_build.Rd index f1fe2c4..dbd367e 100644 --- a/man/idx_build.Rd +++ b/man/idx_build.Rd @@ -18,7 +18,7 @@ character. Unique representation of the relevant "INDEX_RC" field. Build "INDEX_RC" identifier based on given row and column information } \examples{ -idx_build(row = 49, col = 11) +idx_build(row = 42, col = 16) } \seealso{ \code{\link[=idx_decompose]{idx_decompose()}} diff --git a/man/idx_decompose.Rd b/man/idx_decompose.Rd index b8a01a9..7915ff9 100644 --- a/man/idx_decompose.Rd +++ b/man/idx_decompose.Rd @@ -16,7 +16,7 @@ integer. Vector of length 2 containing row and column numbers. Extract row and column information from "INDEX_RC" identifier } \examples{ -idx_decompose(x = "49011") +idx_decompose(x = "42016") } \seealso{ \code{\link[=idx_build]{idx_build()}} diff --git a/man/idx_exists.Rd b/man/idx_exists.Rd index f1fea2d..551bb6e 100644 --- a/man/idx_exists.Rd +++ b/man/idx_exists.Rd @@ -16,5 +16,5 @@ logical. Check whether given "INDEX_RC" is present in KOSTRA-DWD-2010R dataset } \examples{ -idx_exists("49011") +idx_exists("42016") } diff --git a/man/plot_idf.Rd b/man/plot_idf.Rd index 6de9e0c..0cd3998 100644 --- a/man/plot_idf.Rd +++ b/man/plot_idf.Rd @@ -21,11 +21,11 @@ ggplot object. Visualize intensity-duration-frequency curves per cell-specific statistics from KOSTRA-DWD-2010R dataset } \examples{ -get_stats("49011") |> plot_idf() +get_stats("42016") |> plot_idf() -get_stats("49011") |> plot_idf(tn = 100) +get_stats("42016") |> plot_idf(tn = 100) -get_stats("49011") |> plot_idf(log10 = TRUE) +get_stats("42016") |> plot_idf(log10 = TRUE) } \seealso{ \code{\link[=get_stats]{get_stats()}} diff --git a/man/view_spatial.Rd b/man/view_spatial.Rd index 74a8d7d..4c88462 100644 --- a/man/view_spatial.Rd +++ b/man/view_spatial.Rd @@ -21,7 +21,7 @@ Interactive visualisation of tile locations from KOSTRA-DWD-2010R dataset \dontrun{ view_spatial() -view_spatial("49011") -view_spatial("49011", file = "kostra2010R_49011.png") +view_spatial("42016") +view_spatial("42016", file = "kostra2010R_42016.png") } } diff --git a/man/write_stats.Rd b/man/write_stats.Rd index 5bffcac..16b0e8f 100644 --- a/man/write_stats.Rd +++ b/man/write_stats.Rd @@ -17,10 +17,10 @@ Write cell-specific statistics from KOSTRA-DWD-2010R dataset to disk } \examples{ \dontrun{ -kostra <- get_stats("49011") +stats <- get_stats("42016") -write_stats(kostra) -write_stats(kostra, file = "kostra2010R_hN_49011.csv") +write_stats(stats) +write_stats(stats, file = "kostra2010R_hN_42016.csv") } } \seealso{