Using `hydroscoper`'s data

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

This vignette shows how to use the package's internal data sets.

Load libraries

library(hydroscoper)
library(tibble)
library(ggplot2)

Data sets

There are three data sets stored in the package. stations is comprised of the stations' id, name, longitude, latitude, etc.

stations

timeseries of the time series' id, the corresponding station, variable type, time step etc.

timeseries

greece_borders is a data-frame for use with the function geom_polygon from the ggplot2 package.

Stations location

stations and greece_borders can be used to create a map with all Hydroscope's stations. Unfortunately, there is a number of them that have erroneous coordinates (over the sea and far from Greece). Also, there are 120 stations with missing coordinates.

ggplot() + 
  geom_polygon(data = greece_borders,
               aes(long, lat, group = group),
               fill = "grey",
               color = NA) +
  geom_point(data = stations,
             aes(x = longitude, y = latitude, color = subdomain)) +
  scale_color_manual(values=c("#E64B35FF", "#4DBBD5FF", "#00A087FF", 
                              "#3C5488FF"))+
  coord_fixed(ratio=1) +
  theme_bw()

Stations with available time series

The location of the stations with time series available to download are presented at the following map.

stations_ts <- subset(stations, station_id %in% timeseries$station_id &
                        subdomain %in% c("kyy", "ypaat"))


ggplot() + 
  geom_polygon(data = greece_borders,
               aes(long, lat, group = group),
               fill = "grey",
               color = NA) +
  geom_point(data = stations_ts,
             aes(x = longitude, y = latitude, color = subdomain)) +
  scale_color_manual(values=c("#00A087FF", "#3C5488FF"))+
  coord_fixed(ratio=1) +
  theme_bw()

Although there is a large number of stations with available data, there is heterogeneity in the coverage of the country.



Try the hydroscoper package in your browser

Any scripts or data that you put into this service are public.

hydroscoper documentation built on May 14, 2021, 5:08 p.m.