Description Usage Arguments See Also Examples
Return a dataset of hydrometric data from a local HYDAT database. Optionally, a target or vector of distances can be passed to extract only the pooling group from a list of stations. If a distance is passed, the target has a distance of zero. If a target is passed, the similarity measure based on the seasonality of the annual maxima are used as the distance.
1 2 3 4 5 6 7 8 9 10 11 |
db |
Path of the HYDAT database. |
sites |
List of stations from which to extract the data. |
target |
Target site. |
distance |
A vector of distance between all sites. The target has distance equal to zero. |
size |
Size of the pooling group. |
pad, tol |
Logical and number of days. Should the daily data be padded. See PadPot. |
DailyPeaksData, SeasonDistance.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ## Not run:
## The variable DB_HYDAT contains the path to the HYDAT database.
DB_HYDAT <- '.../Hydat.sqlite3'
## Meta-information about stations
gaugedSites <- read.csv('.../gauged_sites.csv')
## Reading AMAX data for one station.
x <- AmaxData(DB_HYDAT, c('01AD002'))
head(x, 3)
## Reading multiple stations.
x <- AmaxData(DB_HYDAT, c('01AD002', '01AF009'))
x[seq(85,95),]
## Reading Daily data.
x <- DailyData(DB_HYDAT, c('01AD002','01AF009'))
head(x, 3)
## A pooling group of size 5 based on seasonality distance.
x <- AmaxData(DB_HYDAT, gaugedSites$station, target = '01AF009', size = 5)
## Extracted site.
sort(unique(x$site))
## Pooling group with different a distance.
meta <- log(gaugedSites[, c('area','map')])
h <- as.matrix(dist(scale(meta)))
x <- AmaxData(DB_HYDAT, gaugedSites$station, distance = h[2,], size = 5)
## Extracted site.
sort(unique(x$site))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.