Skip to content

Commit 5384c92

Browse files
committed
rename pkg
1 parent 9b5e286 commit 5384c92

20 files changed

+186
-178
lines changed

DESCRIPTION

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
Package: EGLVgauges
2-
Title: Web-scraping EGLV gauge (meta-)data
3-
Version: 0.2.5
4-
Date: 2024-12-26
1+
Package: NRWgauges
2+
Title: Web-scraping gauge (meta-)data from various providers in NRW, Germany
3+
Version: 0.3.0
4+
Date: 2024-12-27
55
Authors@R:
66
person("Dimitri", "Falk", , "falk.dimitri@eglv.de", role = c("aut", "cre"))
7-
Description: Granting easy access to gauge (meta-)data published at pegel.eglv.de.
7+
Description: Granting easy access to gauge (meta-)data published on distributed
8+
web-based platforms by various water management associations.
89
License: AGPL (>= 3)
910
Encoding: UTF-8
1011
Roxygen: list(markdown = TRUE)
@@ -26,5 +27,3 @@ Suggests:
2627
httptest,
2728
testthat (>= 3.0.0)
2829
Config/testthat/edition: 3
29-
LazyData: true
30-
LazyDataCompression: bzip2

NAMESPACE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Generated by roxygen2: do not edit by hand
22

3-
export(get_gauges)
4-
export(get_measurements)
5-
export(get_meta)
3+
export(get_eglv_gauges)
4+
export(get_eglv_measurements)
5+
export(get_eglv_meta)
File renamed without changes.

R/get_gauges.R renamed to R/get_eglv_gauges.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
#'
66
#' @examples
77
#' \dontrun{
8-
#' get_gauges()
8+
#' get_eglv_gauges()
99
#' }
10-
get_gauges <- function() {
10+
get_eglv_gauges <- function() {
1111

1212
# debugging ------------------------------------------------------------------
1313

R/get_measurements.R renamed to R/get_eglv_measurements.R

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
#' Get water level or discharge measurements for selected gauges
22
#'
33
#' @param x Sf object containing gauges to be used for subsequent queries,
4-
#' as provided by `get_gauges()`.
4+
#' as provided by `get_eglv_gauges()`.
55
#' @param discharge logical. Retrieve water level or discharge data?
66
#'
77
#' @return List of xts objects.
88
#' @export
99
#'
10-
#' @seealso [get_gauges()]
10+
#' @seealso [get_eglv_gauges()]
1111
#'
1212
#' @examples
1313
#' \dontrun{
14-
#' gauge <- get_gauges() |> dplyr::filter(id == "10103")
14+
#' gauge <- get_eglv_gauges() |> dplyr::filter(id == "10103")
1515
#'
16-
#' get_measurements(gauge)
17-
#' get_measurements(gauge, discharge = TRUE)
16+
#' get_eglv_measurements(gauge)
17+
#' get_eglv_measurements(gauge, discharge = TRUE)
1818
#'
19-
#' gauges <- get_gauges() |> dplyr::filter(waterbody == "Hammbach")
19+
#' gauges <- get_eglv_gauges() |> dplyr::filter(waterbody == "Hammbach")
2020
#'
21-
#' get_measurements(gauges)
21+
#' get_eglv_measurements(gauges)
2222
#' }
23-
get_measurements <- function(x = NULL,
23+
get_eglv_measurements <- function(x = NULL,
2424
discharge = FALSE) {
2525

2626
# debugging ------------------------------------------------------------------
2727

28-
# x <- get_gauges() |> dplyr::filter(id == "10103")
28+
# x <- get_eglv_gauges() |> dplyr::filter(id == "10103")
2929
# discharge <- FALSE
3030

3131
# check arguments ------------------------------------------------------------
@@ -78,7 +78,7 @@ get_measurements <- function(x = NULL,
7878
names(meas) <- par
7979

8080
# add meta data
81-
meta <- get_meta(x[i, ])
81+
meta <- get_eglv_meta(x[i, ])
8282

8383
attr(meas, "STAT_ID") <- meta |> dplyr::pull("id")
8484
attr(meas, "STAT_NAME") <- meta |> dplyr::pull("name")

R/get_meta.R renamed to R/get_eglv_meta.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
#' Get (extended) metadata for selected gauges
22
#'
33
#' @param x Sf object containing gauges to be used for subsequent queries,
4-
#' as provided by `get_gauges()`.
4+
#' as provided by `get_eglv_gauges()`.
55
#'
66
#' @return Tibble containing metadata.
77
#' @export
88
#'
9-
#' @seealso [get_gauges()]
9+
#' @seealso [get_eglv_gauges()]
1010
#'
1111
#' @examples
1212
#' \dontrun{
13-
#' gauge <- get_gauges() |> dplyr::filter(id == "10103")
14-
#' get_meta(gauge)
13+
#' gauge <- get_eglv_gauges() |> dplyr::filter(id == "10103")
14+
#' get_eglv_meta(gauge)
1515
#'
16-
#' gauges <- get_gauges() |> dplyr::filter(waterbody == "Hammbach")
17-
#' get_meta(gauges)
16+
#' gauges <- get_eglv_gauges() |> dplyr::filter(waterbody == "Hammbach")
17+
#' get_eglv_meta(gauges)
1818
#' }
19-
get_meta <- function(x = NULL) {
19+
get_eglv_meta <- function(x = NULL) {
2020

2121
# debugging ------------------------------------------------------------------
2222

23-
# x <- get_gauges() |> dplyr::filter(id == "10103")
23+
# x <- get_eglv_gauges() |> dplyr::filter(id == "10103")
2424

2525
# check arguments ------------------------------------------------------------
2626

R/zzz.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.onAttach <- function(libname, pkgname) {
22

3-
pkg <- "EGLVgauges"
3+
pkg <- "NRWgauges"
44

55
utils::packageVersion(pkg) |> packageStartupMessage()
66
}

README.Rmd

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,41 @@ knitr::opts_chunk$set(
1313
)
1414
```
1515

16-
# EGLVgauges
16+
# NRWgauges
1717

1818
<!-- badges: start -->
19-
[![R-CMD-check](https://github.com/dimfalk/EGLVgauges/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dimfalk/EGLVgauges/actions/workflows/R-CMD-check.yaml)
20-
[![codecov](https://codecov.io/gh/dimfalk/EGLVgauges/branch/main/graph/badge.svg?token=3JJOI51OT8)](https://codecov.io/gh/dimfalk/EGLVgauges)
19+
[![R-CMD-check](https://github.com/dimfalk/NRWgauges/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dimfalk/NRWgauges/actions/workflows/R-CMD-check.yaml)
20+
[![codecov](https://codecov.io/gh/dimfalk/NRWgauges/branch/main/graph/badge.svg?token=3JJOI51OT8)](https://codecov.io/gh/dimfalk/NRWgauges)
2121
<!-- badges: end -->
2222

23-
EGLVgauges aims to grant easy access to EGLV gauge data and metadata published at [pegel.eglv.de](https://pegel.eglv.de/).
23+
NRWgauges aims to grant easy access to gauge (meta-)data published on distributed web-based platforms by various water management associations in North Rhine-Westphalia, Germany.
24+
25+
As of today, the following platforms can be harvested:
26+
27+
- pegel.eglv.de (Emschergenossenschaft / Lippeverband)
2428

2529
## Installation
2630

27-
You can install the development version of EGLVgauges with:
31+
You can install the development version of NRWgauges with:
2832

2933
``` r
3034
# install.packages("devtools")
31-
devtools::install_github("dimfalk/EGLVgauges")
35+
devtools::install_github("dimfalk/NRWgauges")
3236
```
3337

3438
and load the package via
3539

3640
```{r}
37-
library(EGLVgauges)
41+
library(NRWgauges)
3842
```
3943

40-
## Basic examples
44+
## Basic example: EGLV
4145

4246
### Get gauge metadata, locations and latest measurements
4347

4448
```{r}
4549
# fetch all available gauges
46-
gauges <- get_gauges()
50+
gauges <- get_eglv_gauges()
4751
gauges
4852
4953
# ... eventually filter the dataset to the objects you're interested in
@@ -54,14 +58,14 @@ gauge
5458
### Get (extended) metadata for selected gauges
5559

5660
```{r}
57-
get_meta(gauge)
61+
get_eglv_meta(gauge)
5862
```
5963

6064
### Get available measurements for selected gauges
6165

6266
```{r}
6367
# fetch water level measurements
64-
meas <- get_measurements(gauge)[[1]]
68+
meas <- get_eglv_measurements(gauge)[[1]]
6569
meas
6670
6771
class(meas)

README.md

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,45 @@
11

22
<!-- README.md is generated from README.Rmd. Please edit that file -->
33

4-
# EGLVgauges
4+
# NRWgauges
55

66
<!-- badges: start -->
77

8-
[![R-CMD-check](https://github.com/dimfalk/EGLVgauges/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dimfalk/EGLVgauges/actions/workflows/R-CMD-check.yaml)
9-
[![codecov](https://codecov.io/gh/dimfalk/EGLVgauges/branch/main/graph/badge.svg?token=3JJOI51OT8)](https://codecov.io/gh/dimfalk/EGLVgauges)
8+
[![R-CMD-check](https://github.com/dimfalk/NRWgauges/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/dimfalk/NRWgauges/actions/workflows/R-CMD-check.yaml)
9+
[![codecov](https://codecov.io/gh/dimfalk/NRWgauges/branch/main/graph/badge.svg?token=3JJOI51OT8)](https://codecov.io/gh/dimfalk/NRWgauges)
1010
<!-- badges: end -->
1111

12-
EGLVgauges aims to grant easy access to EGLV gauge data and metadata
13-
published at [pegel.eglv.de](https://pegel.eglv.de/).
12+
NRWgauges aims to grant easy access to gauge (meta-)data published on
13+
distributed web-based platforms by various water management associations
14+
in North Rhine-Westphalia, Germany.
15+
16+
As of today, the following platforms can be harvested:
17+
18+
- pegel.eglv.de (Emschergenossenschaft / Lippeverband)
1419

1520
## Installation
1621

17-
You can install the development version of EGLVgauges with:
22+
You can install the development version of NRWgauges with:
1823

1924
``` r
2025
# install.packages("devtools")
21-
devtools::install_github("dimfalk/EGLVgauges")
26+
devtools::install_github("dimfalk/NRWgauges")
2227
```
2328

2429
and load the package via
2530

2631
``` r
27-
library(EGLVgauges)
28-
#> 0.2.5
32+
library(NRWgauges)
33+
#> 0.3.0
2934
```
3035

31-
## Basic examples
36+
## Basic example: EGLV
3237

3338
### Get gauge metadata, locations and latest measurements
3439

3540
``` r
3641
# fetch all available gauges
37-
gauges <- get_gauges()
42+
gauges <- get_eglv_gauges()
3843
gauges
3944
#> Simple feature collection with 112 features and 12 fields
4045
#> Geometry type: POINT
@@ -83,7 +88,7 @@ gauge
8388
### Get (extended) metadata for selected gauges
8489

8590
``` r
86-
get_meta(gauge)
91+
get_eglv_meta(gauge)
8792
#> # A tibble: 1 × 9
8893
#> id name waterbody municipality X Y river_km catchment_area
8994
#> <chr> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl>
@@ -95,33 +100,33 @@ get_meta(gauge)
95100

96101
``` r
97102
# fetch water level measurements
98-
meas <- get_measurements(gauge)[[1]]
103+
meas <- get_eglv_measurements(gauge)[[1]]
99104
meas
100105
#> Warning: object timezone ('etc/GMT-1') is different from system timezone ('')
101106
#> NOTE: set 'options(xts_check_TZ = FALSE)' to disable this warning
102107
#> This note is displayed once per session
103108
#> Wasserstand
104-
#> 2024-10-28 21:20:00 68
105-
#> 2024-10-28 21:25:00 68
106-
#> 2024-10-28 21:30:00 68
107-
#> 2024-10-28 21:35:00 68
108-
#> 2024-10-28 21:40:00 68
109-
#> 2024-10-28 21:45:00 68
110-
#> 2024-10-28 21:50:00 69
111-
#> 2024-10-28 21:55:00 69
112-
#> 2024-10-28 22:00:00 69
113-
#> 2024-10-28 22:05:00 69
109+
#> 2024-10-29 12:20:00 75
110+
#> 2024-10-29 12:25:00 75
111+
#> 2024-10-29 12:30:00 75
112+
#> 2024-10-29 12:35:00 75
113+
#> 2024-10-29 12:40:00 75
114+
#> 2024-10-29 12:45:00 75
115+
#> 2024-10-29 12:50:00 75
116+
#> 2024-10-29 12:55:00 75
117+
#> 2024-10-29 13:00:00 75
118+
#> 2024-10-29 13:05:00 75
114119
#> ...
115-
#> 2024-12-26 20:30:00 85
116-
#> 2024-12-26 20:35:00 85
117-
#> 2024-12-26 20:40:00 86
118-
#> 2024-12-26 20:45:00 86
119-
#> 2024-12-26 20:50:00 86
120-
#> 2024-12-26 20:55:00 86
121-
#> 2024-12-26 21:00:00 86
122-
#> 2024-12-26 21:05:00 86
123-
#> 2024-12-26 21:10:00 86
124-
#> 2024-12-26 21:15:00 86
120+
#> 2024-12-27 11:25:00 85
121+
#> 2024-12-27 11:30:00 85
122+
#> 2024-12-27 11:35:00 84
123+
#> 2024-12-27 11:40:00 84
124+
#> 2024-12-27 11:45:00 84
125+
#> 2024-12-27 11:50:00 84
126+
#> 2024-12-27 11:55:00 84
127+
#> 2024-12-27 12:00:00 84
128+
#> 2024-12-27 12:05:00 84
129+
#> 2024-12-27 12:10:00 84
125130

126131
class(meas)
127132
#> [1] "xts" "zoo"
-50 Bytes
Loading

man/get_gauges.Rd renamed to man/get_eglv_gauges.Rd

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/get_eglv_measurements.Rd

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)