UK National River Flow Archive Data from R
Overview
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.
date: 2025/08/20
small changes:
- changes in test functions: some tests were failing due to some changes in NRFA outputs
From NEWS.md in the release
Install
Health
ERRORtestsr-release-macos-x86_64
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 haltedNOTER code for possible problemsr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc, r-devel-linux-x86_64-fedora-clang, r-devel-linux-x86_64-fedora-gcc, r-devel-windows-x86_64
Found calls to structure() using deprecated special names: rnrfa/tests/testthat/test-get_ts.R (.Dim: 3, .Dimnames: 3, .Names: 3) rnrfa/tests/testthat/test-osg_parse.R (.Names: 7) '.Dim' should be changed to 'dim'. '.Dimnames' should be changed to 'dimnames'. '.Names' should be changed to 'names'.
- ERROR7 OK, 5 NOTE, 1 ERRORNow
- ERROR12 OK, 1 ERROR2026-05-02
- OK14 OK2026-03-10
Documentation
- Help pages
- 12includes a package overview page
- Examples that run
- 0%10 never run
- Exported functions with examples
- 91%
- Documented parameters
- 100%
- Return-value docs
- 91%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 198
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
PRs over time
6 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/ilapros/rnrfa on 2026-10-25.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
Dependencies
Installing rnrfa adds 54 packages (37 with compiled code, 55 MB of source tarballs). Heaviest: stringi 11 MB, sf 9.3 MB, ggplot2 6.0 MB.
Code & Tests
People & History
Previously maintained by Claudia Vitolo (0.1.0 to 2.0.4).
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 2.1.0.7Latest
- RR 4.5.0 released · 2025-04-11
- 2.1.0.6
- RR 4.4.0 released · 2024-04-24
- 2.1.0.52024-02-15 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 2.1.02022-09-08 · diff ↗
- 2.0.62022-08-09 · diff ↗
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- unarchivedReturned to CRAN2021-02-15
- 2.0.42021-02-15 · diff ↗
- archivedRemoved from CRAN2021-02-08policy violation On Internet access
- 2.0.32020-05-25 · diff ↗
- RR 4.0.0 released · 2020-04-24
Show 23 earlier eventsHide 23 earlier events
- 2.0.22020-02-01 · diff ↗
- 2.0.12019-11-10 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 2.0
- 1.5.02018-11-20 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 1.4.02018-04-13 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 1.3.02016-12-24 · diff ↗
- 1.22016-09-03 · diff ↗ ·
removed 7 exports
CMR, GDF, OSGparse, convertFlow, plotRainFlow, plotTrend, seasonalAveragesadded 7 exports
cmr, convert_flow, gdf, osg_parse, plot_rain_flow, plot_trend, seasonal_averages - 0.5.42016-08-24 · diff ↗
- 0.5.3
- RR 3.3.0 released · 2016-05-03
- 0.5.1
- 0.4.32016-02-25 · diff ↗ ·
removed 4 exports
NRFA_Catalogue, OSG2LatLon, OSGParse, ToJSONarrayadded 2 exports
catalogue, OSGparse - archivedRemoved from CRAN2016-02-19requested by the maintainer <cvitolodev@gmail.com>
- 0.3.02015-11-20 · diff ↗ ·
removed 2 exports
NRFA_TSdata, NRFA_TSmetadataadded 4 exports
GDF, GDFmeta, CMR, CMRmeta - 0.2.1
- 0.2.02015-07-03 · diff ↗ ·
removed 2 exports
GetStationSummary, SearchNRFAadded 2 exports
NRFA_Catalogue, NRFA_TS - RR 3.2.0 released · 2015-04-16
- 0.1.52014-11-07 · diff ↗
- 0.1.02014-08-15
- RR 3.1.0 released · 2014-04-10
Package metadata
- First published
- 2014-08-15
- Total releases
- 23 / 12 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 3.5
- Download size
- 366 KB
Cite
Cite this package
Run in R for the authors' entry:
citation("rnrfa")The package provides a citation file, so citation() returns the authors' own entry.
It points to 10.5281/zenodo.593201.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.