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 (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 Python notebooks and the WaterML R library 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:
http://127.0.0.1:8888/?token=my_generated_token
5) Enter the work directory from the left side panel.
6) Open the Plata-INA notebook clicking on the file icon: 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 WHOS-Plata.
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-Plata and then do comprehensive analyse.