This vignette shows how to create a tidy dataframe for the stations’ and time-series’ data from Hydroscope. The subdomain of Hydroscope that we will aplly the package’s functions is http:/kyy.hydroscope.gr
The following code, with the use of ldply function from plyr package, shows how to create a tidy dataframe with all the values of the stations, including their coordinates and elevation, from a subdomain.
library(hydroscoper)
library(plyr)
subdomain <- "kyy"
# get stations data
stations <- get_stations(subdomain)
# get coordinates and elevation
coords <- ldply(stations$StationID, function(id) {
get_coords(subdomain, id)
})
# merge data
stations <- merge(stations, coords, by = "StationID", all.x = TRUE)
# show data
head(stations)
The following code shows, with the use of ldply function from plyr package, how to create a tidy dataframe with all the time series from the subdomain.