https://github.com/cvitolo/rnrfa
RNRFA: an R package to interact with the UK National River Flow Archive
Science Score: 23.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
○codemeta.json file
-
○.zenodo.json file
-
✓DOI references
Found 3 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.5%) to scientific vocabulary
Repository
RNRFA: an R package to interact with the UK National River Flow Archive
Basic Info
- Host: GitHub
- Owner: cvitolo
- Language: R
- Default Branch: master
- Homepage: http://cvitolo.github.io/rnrfa/
- Size: 1.69 MB
Statistics
- Stars: 11
- Watchers: 6
- Forks: 13
- Open Issues: 4
- Releases: 0
Metadata Files
README.md
rnrfa
An R package to Retrieve, Filter and Visualize Data from the UK National River Flow Archive
Update on 01-03-2021: the maintainer of this package has changed. The latest version of rnrfa is now available at https://github.com/ilapros/rnrfa
The UK National River Flow Archive serves daily streamflow data, spatial rainfall averages and information regarding elevation, geology, land cover and FEH related catchment descriptors.
There is currently an API under development that in future should provide access to the following services: metadata catalogue, catalogue filters based on a geographical bounding-box, catalogue filters based on metadata entries, gauged daily data for about 400 stations available in WaterML2 format, the OGC standard used to describe hydrological time series.
The information returned by the first three services is in JSON format, while the last one is an XML variant.
The RNRFA package aims to achieve a simpler and more efficient access to data by providing wrapper functions to send HTTP requests and interpret XML/JSON responses.
Installation
The stable version of the rnrfa package is available from CRAN:
r
install.packages("rnrfa")
Or the development version from GitHub using the package remotes:
r
install.packages("remotes")
remotes::install_github("cvitolo/rnrfa")
Now, load the rnrfa package:
r
library(rnrfa)
Examples
Retrieve information for all the stations in the catalogue
The R function that deals with the NRFA catalogue to retrieve the full list of monitoring stations is called catalogue(). The function, used with no inputs, requests the full list of gauging stations with associated metadata. The output is a dataframe containing one record for each station and as many columns as the number of metadata entries available.
r
allStations <- catalogue()
The same function catalogue() can be used to filter stations based on a bounding box or any of the metadata entries.
``` r
Define a bounding box:
bbox <- list(lonmin=-3.82, lonmax=-3.63, latmin=52.43, latmax=52.52)
Filter stations based on bounding box
someStations <- catalogue(bbox) ```
Conversions of OS grid references
The only geospatial information contained in the list of station in the catalogue is the OS grid reference (column "gridRef"). The RNRFA package allows convenient conversion to more standard coordinate systems. The function "osg_parse()", for example, converts the string to easting and northing in the BNG coordinate system (EPSG code: 27700), as in the example below:
``` r
Where is the first catchment located?
someStations$grid-reference$ngr[1]
Convert OS Grid reference to BNG
osgparse(gridrefs = "SN853872") ```
The same function can also convert from BNG to latitude and longitude in the WSGS84 coordinate system (EPSG code: 4326) as in the example below.
``` r
Convert BNG to WSGS84
osgparse(gridrefs = "SN853872", coord_system = "WGS84") ```
osg_parse() also works with multiple references:
r
osg_parse(someStations$`grid-reference`$ngr)
Time series data
The first column of the table "someStations" contains the id number. This can be used to retrieve time series data and convert waterml2 files to time series object (of class zoo).
The National River Flow Archive serves two types of time series data: gauged daily flow and catchment mean rainfall.
Catchment mean rainfall:
r
info <- cmr(id = "3001")
plot(info)
Gauged daily flow:
r
info <- gdf(id = "3001")
plot(info)
For more examples and details, please see the vignette.
Terms and Conditions
Please refer to the following Terms and Conditions for use of NRFA Data and disclaimer: https://nrfa.ceh.ac.uk/costs-terms-and-conditions
This package uses a non-public API which is likely to change. Package and functions herein are provided as is, without any guarantee.
Meta
- Please report any issues or bugs.
- License: GPL-3
- Get citation information for
rnrfain R doingcitation(package = 'rnrfa')
Owner
- Name: Claudia Vitolo
- Login: cvitolo
- Kind: user
- Location: Europe
- Company: @esa
- Twitter: clavitolo
- Repositories: 20
- Profile: https://github.com/cvitolo
GitHub Events
Total
Last Year
Committers
Last synced: about 1 year ago
Top Committers
| Name | Commits | |
|---|---|---|
| Claudia Vitolo | c****o@g****m | 190 |
| Ilaria Prosdocimi | p****a@g****m | 3 |
| Michael Sumner | m****r@g****m | 2 |
| Alexander Hurley | t****l | 1 |
| Tobias Gauster | t****r@k****t | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: about 1 year ago
All Time
- Total issues: 23
- Total pull requests: 13
- Average time to close issues: 4 months
- Average time to close pull requests: 6 days
- Total issue authors: 11
- Total pull request authors: 8
- Average comments per issue: 2.74
- Average comments per pull request: 1.62
- Merged pull requests: 10
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- cvitolo (8)
- rossmounce (3)
- the-Hull (1)
- bogsnork (1)
- rsbivand (1)
- ambroisebaker (1)
- Xifip (1)
- ilapros (1)
- mattfry-ceh (1)
- btojenniferborder (1)
- peterlevy (1)
Pull Request Authors
- ilapros (4)
- cvitolo (3)
- mikerspencer (1)
- mundl (1)
- mdsumner (1)
- fromandemo (1)
- the-Hull (1)
- MichaelChirico (1)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- R >= 3.5 depends
- curl * imports
- ggmap * imports
- ggplot2 * imports
- graphics * imports
- httr * imports
- jsonlite * imports
- lubridate * imports
- parallel * imports
- rgdal * imports
- sp * imports
- stats * imports
- tibble * imports
- zoo * imports
- covr * suggests
- knitr * suggests
- lintr * suggests
- rmarkdown * suggests
- testthat * suggests