R scripts for the Hydro App