R is a programming language and free software environment for statistical computing and graphics supported by the R Foundation for Statistical Computing.
The R WaterML library is a software package made by Jiri Kadlec that can be used by developers to access to WHOS functionalities from their R applications.
You can find here the official homepage of R WaterML library.
With Google Colab and Jupyter notebook web applications is possible to live demonstrate on the web how such a library can be used from a sample R script. Here are the online links:
- Google Colab notebook sample connecting to WHOS-Arctic (hosted by Google): https://colab.research.google.com/drive/1SEEBM5LnUbZdhTltNwc2baauL2-hDNXF
- Google Colab notebook sample connecting to WHOS-Plata (hosted by Google): https://colab.research.google.com/drive/1mm3OrERZezUOH5O8Gp-Gs133MwbsCVvy
- A Jupyter notebook prepared and hosted by ARPAE Emilia-Romagna.
- A Jupyter notebook is made available through Docker from ESSI-Lab. This environment can be reproduced following the below steps.
1) Download the above WaterML R library and the Python notebooks you are interested to try in a local folder.
2) Install Docker
3) From that folder, issue the following command to start the Jupyter Notebook as a localhost service.
docker run --rm -p 8888:8888 -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/home/jovyan/work/ jupyter/r-notebook
4) Read carefully the logs to findout the URL to use in the browser to acces the web GUI. This will be something like:
5) Enter the work directory from the left side panel.
6) Open one of the notebook available clicking on the file icon on the left (e.g. WHOS-Plata-INA): the script, along with results and comments should shown in the main panel.
7) Click on Run → Run All Cells to execute the R code on the fly. The first cells will install the provided R WaterML package.
Then, using methods made available by the library, it is shown how it is possible to search and access data from one of the available views of WHOS.
In particular data from a station managed by INA is finally plotted. Of course this is just a quick sample. An hydrologist could of course expand example given doing further data gathering from the different providers participating in WHOS and then do comprehensive analyse.