What does hyetor

hyetor provides functionality to analyze fixed interval precipitation records. The functions that are provided are the family of functions: hyet_create(), hyet_fill, hyet_aggregate, etc., to easily preprocess and analyze precipitation time-series. All these functions return their results as tibbles and make use of magrittr’s pipe operator %>% to improve the readability and maintainability of code.

Internal data-sets

This time series comes from the weather station ‘Arna’ in Greece with coordinates 36.88002, 22.41292 (ETRS89) and altitude 779 m. The owner of that weather station is the Ministry of Environment and Energy. Precipitation’s units of measurement is in mm and the time step is five minutes.

Example

This is a minimal example which shows how to use the package’s functions to analyze the internal data set.

Load libraries and view the first rows of the internal precipitation time-series:

Let’s create a plot:

prec5min %>%
  ggplot(aes(x = date, y = prec)) +
  geom_line() +
  ylab("Precipitation (mm)") +
  xlab("Date") +
  theme_bw()

Preprocessing

The hyet_fill function is used to fill missing date values with NA values. This function can be used when missing values in time series are marked implicitly using missing dates.

Let’s use the hyet_fill function and plot again the data

prec_filled <- prec5min %>%
  hyet_fill(time_step = 5, ts_unit = "mins")

prec_filled %>%
  ggplot(aes(x = date, y = prec)) +
  geom_line() +
  ylab("Precipitation (mm)") +
  xlab("Date") +
  theme_bw()