## Ex1: Computation of mean WEEKLY values from DAILY ts, removing any missing value in 'x'
# Loading DAILY streamflows (3 years) at the station
# Oca en Ona (Ebro River basin, Spain)
data(OcaEnOnaQts)
x <- OcaEnOnaQts
## Mean WEEKLY streamflows at station 'x'
weeklyfunction(x, FUN=mean, na.rm=TRUE)
######################
## Ex2: Computation of mean WEEKLY values from HOURLY ts, removing any missing value in 'x'
# Loading HOURLY streamflows for the station Karamea at Gorge
data(KarameaAtGorgeQts)
x <- KarameaAtGorgeQts
## Mean WEEKLY streamflows at station 'x'. Each day starts at 00:00:00
weeklyfunction(x, FUN=mean, na.rm=TRUE)
######################
## Ex3: Computation of mean WEEKLY values from HOURLY ts, removing any missing value in 'x'
## and starting each day at 08:00:00
# Loading HOURLY streamflows for the station Karamea at Gorge
data(KarameaAtGorgeQts)
x <- KarameaAtGorgeQts
## Mean WEEKLY streamflows at station 'x'. Each day starts at 00:00:00
weeklyfunction(x, FUN=mean, na.rm=TRUE, start="00:00:00")
Run the code above in your browser using DataLab