{"id":47311347,"url":"https://github.com/eheisman/hydroutils","last_synced_at":"2026-03-17T11:35:13.983Z","repository":{"id":70473428,"uuid":"45804592","full_name":"eheisman/hydroutils","owner":"eheisman","description":"An R package for handling hydrology data and plotting hydrologic frequency curves.  Forked from DSSRip","archived":false,"fork":false,"pushed_at":"2016-08-19T04:32:36.000Z","size":820,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-01-29T21:30:43.851Z","etag":null,"topics":["civil-engineering","flow-frequency-graphics","ggplot2","hydrology","plotting","r","statistics"],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eheisman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2015-11-08T23:46:24.000Z","updated_at":"2023-04-14T19:16:34.000Z","dependencies_parsed_at":"2023-04-27T23:37:54.929Z","dependency_job_id":null,"html_url":"https://github.com/eheisman/hydroutils","commit_stats":{"total_commits":17,"total_committers":3,"mean_commits":5.666666666666667,"dds":"0.47058823529411764","last_synced_commit":"96d0f136e08f417601c10cfb5ad3d6e2a56334a8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eheisman/hydroutils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eheisman%2Fhydroutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eheisman%2Fhydroutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eheisman%2Fhydroutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eheisman%2Fhydroutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eheisman","download_url":"https://codeload.github.com/eheisman/hydroutils/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eheisman%2Fhydroutils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30622771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T11:26:08.186Z","status":"ssl_error","status_checked_at":"2026-03-17T11:24:37.311Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["civil-engineering","flow-frequency-graphics","ggplot2","hydrology","plotting","r","statistics"],"created_at":"2026-03-17T11:35:12.201Z","updated_at":"2026-03-17T11:35:13.978Z","avatar_url":"https://github.com/eheisman.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hydroutils\nAn R package for handling hydrology data and plotting hydrologic frequency curves.  Forked from DSSRip to provide these functions in a cross-platform environment.  This package should not require the links to DSSVue and should be useful for more general hydrologic analysis.\n\n`wateryear`, similar to the `lubridate` package's `year` function, returns the water year for a timestamp (starting 01 Oct of the previous calendar year). `wymonth` returns the month of the water year, starting with October, and the `wy.month.abb` constant contains the month abreviations in this order.  `wyday` returns the day of the wateryear, with 1 being Oct 1st and 356 or 366 being Sept 30th depending on if it is a leap year or not.\n\nFor assessing the fit of hydrologic models, the functions `nash.sutcliffe`, `rmse`, and `excelR2` are provided.  The `nash.sutcliffe` function supports an argument `x.alt` to replace the mean of the `x.obs` dataset with a different alternative model to provide more resolution in the resulting score.  This can either be the best 'dumb' model output, where no calibration is required to get a reasonable answer.\n\n`weibullProbs` returns the corresponding Weibull plotting position for a given vector to plot on a flow-frequency graphic.\n\n`hydro_flow_trans` and `hydro_prob_trans` can be used with `ggplot`'s `scale_continuous` for axes to automatically apply flowBreaks and probBreaks.  These call the methods `flowBreaks` and `probBreaks` for generating breaks on a plot with logarithmic and normal-deviate axes, such as those used for flow frequency graphics.\n\n# Examples:\n\nThe example below has been superceeded by [one in the examples directory](https://github.com/eheisman/hydroutils/blob/master/examples/hydroutil_examples.md) which retrieves data from the USGS via their [`dataRetrieval` package](https://github.com/USGS-R/dataRetrieval).  If you do not want to install (on Windows) or cannot install (on Mac and Linux) the `dssrip` library, the DSS references the files below can be replaced with either the `nile` dataset or data obtained through the USGS's `dataRetrieval` package)*\n\n## Frequency curve\nannual_peaks_data.dss contains a record with a USGS flow frequency record.\n\n```r\nrequire(hydroutils)\nrequire(dssrip) # or use your own data or the R example 'nile' dataset\nrequire(ggplot2)\nrequire(scales)\n\ntestfile = opendss(\"C:/path/to/annual_peaks_data.dss\")\npeaks = getFullTSC(testfile, getPaths(testfile, \"C=FLOW-*\")[1])\ncolnames(peaks) = \"FLOW\"\npeaks = fortify(peaks) ## xts to data.frame for ggplot2\n\nggplot(peaks, aes(y=FLOW, x=weibullProbs(FLOW))) + geom_point() + \n  theme_bw(base_size=11) + theme(legend.position = \"bottom\", panel.grid.minor=element_blank()) +\n  scale_y_continuous(trans=hydro_flow_trans()) + \n  scale_x_continuous(trans=hydro_prob_trans(lines=c(1,2,5), labels=c(1,2,5), byPeriod=TRUE)) + \n  stat_smooth(method=\"glm\", family=gaussian(link=\"log\"))\n```\n\n## Quick monthly summary hydrograph\ntest.dss contains a daily flow record downloaded with the USGS Import tool in DSSVue for the Delaware River at Trenton, NJ (USGS #01463500).  This isn't the best example of a summary hydrograph, and definitely not the best way to do it, but gives an idea of seasonality and creating a WY based plot with `wymonth` and `wymonth.abb`.\n\n```r\nrequire(hydroutils)\nrequire(dssrip)\nrequire(ggplot2) # for plotting and fortify command\nmydssfile = opendss(\"F:/test.dss\")\n\ndelawareflows = getFullTSC(mydssfile, getPaths(mydssfile, \"A=DELAWARE RIVER B=TRENTON NJ C=FLOW\"))\nplot(delawareflows)\n## uses fortify.xts from ggplot, creates column for index.\ndeflow = fortify(delawareflows)\n## Let's label months and assign them a WY order (October thru Sept)\ndeflow$MONTH = factor(x=wymonth(deflow$Index), labels=wymonth.abb)\n## plot\nggplot(deflow, aes(x=MONTH, y=FLOW, group=MONTH)) + geom_boxplot()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feheisman%2Fhydroutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feheisman%2Fhydroutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feheisman%2Fhydroutils/lists"}