<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/%e1%bd%95%ce%b4%cf%89%cf%81-%cf%83%ce%ba%ce%bf%cf%80%e1%bf%b6-water-observe/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://ropensci.org/blog/2018/04/03/hydroscoper/"> rOpenSci - open tools for open science</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<blockquote>
<p>Hydrology is a concept to unify statistics, data analysis and numerical models in order to understand and analyze the endless circulation of water between the earth and its atmosphere.</p>
</blockquote>
<p>That’s a lot alike Data Science, isn’t it? Hydrologic Processes evolve in space and time, are extremely complex and we may never comprehend them. For this reason Hydrologists use models where their inputs and outputs are measurable variables: climatic and hydrologic data, land uses, vegetation coverage, soil type etc.</p>
<p>Not so many years ago, I used to struggle for these data that were available mostly in hand-written form: travelling 500 km away searching in underground storages, requesting from peers and institutes or even use sophistries[<sup><a rel="nofollow" href="https://ropensci.org/blog/2018/04/03/hydroscoper/#fn:1" target="_blank">1</a></sup>] to get them. Nowadays, hydrologic data come from a variety of sources such as satellites, online weather stations, national climatic databases, etc. But problems never end: these data have a variety of types and formats, errors, noise and a large proportion of missing values.</p>
<p>In Greece, the Hydroscope (ὕδωρ + σκοπῶ) project started in the 1990s, aimed to organize data belonging to various institutions and to create a database of hydrometeorological information. Today this database, <a rel="nofollow" href="http://www.hydroscope.gr/" target="_blank">Hydroscope</a>, is available online. Unfortunately, all the data in Hydroscope are in Greek and there are no convenient look-up tables.</p>
<h3>The hydroscoper package</h3>
<p><code>hydroscoper</code> is an R package designed to provide functionality for automatic retrieval and translation of Hydroscope’s data to English. Furthermore, the internal data sets can be used to run queries on the available weather stations, gauging stations and time series, reducing the time needed for downloading and data wrangling.</p>
<h3>Installation</h3>
<p>The package is available in <a rel="nofollow" href="https://cran.r-project.org/web/packages/hydroscoper/index.html" target="_blank">CRAN</a> and can be installed with:</p>
<pre><code>install.packages(&quot;hydroscoper&quot;)
</code></pre>
<p>The development version from GitHub can be installed using <a rel="nofollow" href="https://cran.r-project.org/web/packages/devtools/index.html" target="_blank">devtools</a>:</p>
<pre><code>devtools::install_github(&quot;ropensci/hydroscoper&quot;)
</code></pre>
<h3>Using the package</h3>
<p>The following code is a demonstration of how to download and plot the available data from a specific station. First of all, the package must be loaded:</p>
<pre><code>library(hydroscoper)
</code></pre>
<p>The time series that will be used come from the station <code>AG. BASILEIOS</code>, in the Greek water division <code>GR13</code>.</p>
<pre><code>stations[stations$name == &quot;AG. BASILEIOS&quot;, ]

##     station_id          name      water_basin water_division
## 1       501032 AG. BASILEIOS KOURTALIOTES P.            GR13
## 358     200280 AG. BASILEIOS KOURTALIOTES P.            GR13
##                owner longitude latitude altitude subdomain
## 1       min_agricult        NA       NA       NA       kyy
## 358 min_envir_energy  24.45425 35.24414    298.6       kyy
</code></pre>
<p>The available time series from this station are:</p>
<pre><code>subset(timeseries, station_id %in% c(501032, 200280))

##     time_id station_id       variable timestep units
## 177     987     200280 wind_direction     </code></pre>