Learn R Programming

hydroTSM (version 0.2-0)

hydroTSM-package: Management, analysis, interpolation and plot of hydrological time series, with focus on hydrological modelling

Description

S3 functions for management, analysis, interpolation and plot of hydrological time series, mainly oriented to hydrological modelling tasks. So far, it only works with daily / monthly / seasonal / annual time series. The focus of this package has been put in providing a collection of tools useful for the daily work of hydrologists (although an effort was made to optimize each function as much as possible, functionality has had priority over speed). Bugs / comments / questions / collaboration of any kind are very welcomed, and in particular, datasets that can be included in this package for academic purposes.

Arguments

Details

ll{ Package: hydroTSM Type: Package Version: 0.2-0 Date: 2010-10-10 License: GPL LazyLoad: yes Packaged: Sun Oct 10 22:47:19 CEST 2010; MZB Built: R version 2.11.1 (2010-05-31); i486-pc-linux-gnu }

See Also

http://cran.r-project.org/web/packages/hydroGOF/. http://rwiki.sciviews.org/doku.php?id=guides:tutorials:hydrological_data_analysis

Examples

Run this code
## Loading the monthly time series (10 years) of precipitation for the Ebro River basin.
data(EbroPPtsMonthly)

#######
## Ex1) Graphical correlation among the ts of monthly precipitation of the first 
##      3 stations in 'EbroPPtsMonthly' (its first column stores the dates).
hydropairs(EbroPPtsMonthly[,2:4])

#######
## Ex2) Annual values of precipitation at the station "P9001"
sname2ts(EbroPPtsMonthly, sname="P9001", dates=1, var.type="Precipitation", 
         tstep.out="annual")

#######
## Ex3) Monthly and annual plots
sname2plot(EbroPPtsMonthly, sname="P9001", var.type="Precipitation", dates=1, pfreq="ma")

#######
## Ex4) IDW interpolation and plot

## Loading the spatial data corresponding to the measurements given by 'EbroPPtsMonthly'
data(EbroPPgis)

## Loading the shapefile (polygon) with the subcatchments
data(EbroCatchmentsCHE)

## Selecting the first day of 'EbroPPtsMonthly' for all the stations
x.ts <- as.numeric(EbroPPtsMonthly[1, 2:ncol(EbroPPtsMonthly)])

## Setting the name of the gauging stations
names(x.ts) <- colnames(EbroPPtsMonthly[1,2:ncol(EbroPPtsMonthly)])

# Computing the interpolated values and plotting them
# Probably you will need to resize your window
x.idw <- hydrokrige(x.ts= x.ts, x.gis=EbroPPgis, 
                    X="EAST_ED50" , Y="NORTH_ED50" , sname="ID", 
                    bname= "CHE_BASIN_NAME", elevation="ELEVATION",
                    type= "both",
                    subcatchments= EbroCatchmentsCHE,
                    cell.size= 1000)

#######
## Ex5)  Mean monthly values of streamflows
## Loading daily streamflows (3 years) at the station 
## Oca en Ona (Ebro River basin, Spain)
data(OcaEnOnaQts)
monthlyfunction(OcaEnOnaQts, FUN=mean, na.rm=TRUE)

Run the code above in your browser using DataLab