Description
Utility functions to retrieve data from the UK National River Flow Archive (<https://nrfa.ceh.ac.uk/>, terms and conditions: <https://nrfa.ceh.ac.uk/help/costs-terms-and-conditions>). The package contains R wrappers to the UK NRFA data temporary-API. There are functions to retrieve stations falling in a bounding box, to generate a map and extracting time series and general information. The package is fully described in Vitolo et al (2016) "rnrfa: An R package to Retrieve, Filter and Visualize Data from the UK National River Flow Archive" <https://journal.r-project.org/archive/2016/RJ-2016-036/RJ-2016-036.pdf>.
Downloads
494
Last 30 days
7633rd
1.2K
Last 90 days
6.7K
Last year
Trend: +54.4% (30d vs prior 30d)
10
Last 30 days
24
Last 90 days
98
Last year
Trend: -28.6% (30d vs prior 30d)
4
Last 7 days
19
Last 30 days
0
All-time
autoCRAN-only: this name is served only by autoCRAN, so the count is exact.
CRAN Check Status
Show all 13 flavors
| Flavor | Status |
|---|---|
| r-devel-linux-x86_64-debian-clang | OK |
| r-devel-linux-x86_64-debian-gcc | OK |
| r-devel-linux-x86_64-fedora-clang | OK |
| r-devel-linux-x86_64-fedora-gcc | OK |
| r-devel-windows-x86_64 | OK |
| r-oldrel-macos-arm64 | OK |
| r-oldrel-macos-x86_64 | OK |
| r-oldrel-windows-x86_64 | OK |
| r-patched-linux-x86_64 | OK |
| r-release-linux-x86_64 | OK |
| r-release-macos-arm64 | OK |
| r-release-macos-x86_64 | ERROR |
| r-release-windows-x86_64 | OK |
Check details (1 non-OK)
tests
Running ‘testthat.R’ [16s/135s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library("testthat")
> library("rnrfa")
> # library("lintr")
>
> api_unavailable <- function(){
+ resp1 <- httr::GET(url = "https://nrfaapps.ceh.ac.uk/nrfa/ws/time-series",
+ query = list(format = "json-object", station = 39001,`data-type` = "gdf"),
+ httr::user_agent("https://github.com/ilapros/rnrfa"))
+ resp2 <- httr::GET(url = "https://nrfaapps.ceh.ac.uk/nrfa/ws/time-series",
+ query = list(format = "json-object", station = 39001,`data-type` = "cmr"),
+ httr::user_agent("https://github.com/ilapros/rnrfa"))
+ # if any of the two streams is not working skip tests
+ (httr::http_error(resp1) | httr::http_error(resp2))
+ }
>
> # skip_if_no_api() <- function() {
> # if (api_unavailable()) {
> # skip("API not available")
> # }
> # }
>
> if (!c
...[truncated]...
═════════════════════════════════════════════════════════
── Error ('test-catalogue.R:17:3'): Output of catalogue function is expected to be at least 1539x20 ──
<curl_error_operation_timedout/curl_error/error/condition>
Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached [nrfaapps.ceh.ac.uk]:
Connection timed out after 10001 milliseconds
Backtrace:
▆
1. ├─testthat::skip_if(api_unavailable(), "API not available") at test-catalogue.R:17:3
2. │ └─base::isTRUE(condition)
3. ├─rnrfa (local) api_unavailable()
4. │ └─httr::GET(...) at test-catalogue.R:4:3
5. │ └─httr:::request_perform(req, hu$handle$handle)
6. │ ├─httr:::request_fetch(req$output, req$url, handle)
7. │ └─httr:::request_fetch.write_memory(req$output, req$url, handle)
8. │ └─curl::curl_fetch_memory(url, handle = handle)
9. └─curl:::raise_libcurl_error(...)
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 66 ]
Error:
! Test failures.
Execution halted
Check History
ERROR 12 OK · 0 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE May 2, 2026
tests
Running ‘testthat.R’ [16s/135s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
> library("testthat")
> library("rnrfa")
> # library("lintr")
>
> api_unavailable <- function(){
+ resp1 <- httr::GET(url = "https://nrfaa
...[truncated]...
::request_fetch.write_memory(req$output, req$url, handle)
8. │ └─curl::curl_fetch_memory(url, handle = handle)
9. └─curl:::raise_libcurl_error(...)
[ FAIL 1 | WARN 0 | SKIP 0 | PASS 66 ]
Error:
! Test failures.
Execution halted