{"id":18592818,"url":"https://github.com/kwb-r/r2q","last_synced_at":"2026-02-05T07:31:38.476Z","repository":{"id":38036906,"uuid":"315580070","full_name":"KWB-R/r2q","owner":"KWB-R","description":"R Package with Functions and Exchange for Project R2Q","archived":false,"fork":false,"pushed_at":"2024-12-29T20:31:13.000Z","size":25550,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-21T20:56:17.720Z","etag":null,"topics":["project-r2q","r-package","rstats"],"latest_commit_sha":null,"homepage":"https://kwb-r.github.io/r2q/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KWB-R.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-11-24T09:22:33.000Z","updated_at":"2021-11-03T10:10:45.000Z","dependencies_parsed_at":"2025-02-17T21:47:42.432Z","dependency_job_id":null,"html_url":"https://github.com/KWB-R/r2q","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/KWB-R/r2q","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KWB-R%2Fr2q","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KWB-R%2Fr2q/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KWB-R%2Fr2q/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KWB-R%2Fr2q/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KWB-R","download_url":"https://codeload.github.com/KWB-R/r2q/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KWB-R%2Fr2q/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29115529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"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":["project-r2q","r-package","rstats"],"created_at":"2024-11-07T01:10:12.804Z","updated_at":"2026-02-05T07:31:38.461Z","avatar_url":"https://github.com/KWB-R.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![R-CMD-check](https://github.com/KWB-R/r2q/workflows/R-CMD-check/badge.svg)](https://github.com/KWB-R/r2q/actions?query=workflow%3AR-CMD-check)\n[![pkgdown](https://github.com/KWB-R/r2q/workflows/pkgdown/badge.svg)](https://github.com/KWB-R/r2q/actions?query=workflow%3Apkgdown)\n[![codecov](https://codecov.io/github/KWB-R/r2q/branch/main/graphs/badge.svg)](https://codecov.io/github/KWB-R/r2q)\n[![Project Status](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)\n[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/r2q)]()\n[![R-Universe_Status_Badge](https://kwb-r.r-universe.dev/badges/r2q)](https://kwb-r.r-universe.dev/)\n\n# r2q\n\nThe R package is used to define a tolerable pollutant input into small\nsurface waters via rainwater runoff. It assigns a maximal connectable urban\narea to the surface water. For planning areas, different scenarios regarding\nthe connection of surfaces to the separate sewer system and runoff water\ntreatment can be calculated.\n\n## Installation\n\nFor details on how to install KWB-R packages checkout our [installation tutorial](https://kwb-r.github.io/kwb.pkgbuild/articles/install.html).\n\n```r\n### Optionally: specify GitHub Personal Access Token (GITHUB_PAT)\n### See here why this might be important for you:\n### https://kwb-r.github.io/kwb.pkgbuild/articles/install.html#set-your-github_pat\n\n# Sys.setenv(GITHUB_PAT = \"mysecret_access_token\")\n\n# Install package \"remotes\" from CRAN\nif (! require(\"remotes\")) {\n  install.packages(\"remotes\", repos = \"https://cloud.r-project.org\")\n}\n\n# Install KWB package 'r2q' from GitHub\nremotes::install_github(\"KWB-R/r2q\")\n```\n## Example \n\u003cdetails\u003e\n  \u003csummary\u003eExample for using the Excel input mask\u003c/summary\u003e\n  \n  ```r\n  path \u003c- file.path(system.file(package = \"r2q\"), \"extdata\", \"Example\")\n  fileName \u003c- \"Herne_Baukau.xlsx\"\n\n  # checkout the example excel file (only works on windows with excel installed)\n  shell.exec(file.path(path, fileName))\n\n  # load Example -----------------------------------------------------------\n  siteData \u003c- r2q::load_site_data(\n    data.dir = path, \n    filename = fileName\n  )\n\n  c_river \u003c- r2q::load_background_data(\n    data.dir = path,\n    filename = fileName, \n    default_for_na = TRUE\n  )\n\n  # load package data ---------------------------------------------------------\n  c_storm \u003c- r2q::get_stormwaterRunoff(\n    runoff_effective_mix = list(\n      siteData$landuse$Mix_flow_connected[c(2,1,3,4)], \n      siteData$landuse$Mix_flow_connectable[c(2,1,3,4)]),\n    mix_names = c(\"is\", \"pot\"))\n\n  c_threshold \u003c- r2q::get_thresholds(LAWA_type = siteData$LAWA_type$Value)\n\n  # yearly rain event\n  rain \u003c- r2q::get_rain(\n    area_catch = siteData$area_catch$Value, \n    river_cross_section = siteData$river_cross_section$Value,\n    river_length = siteData$river_length$Value, \n    river_mean_flow = siteData$Q_mean$Value,\n    x_coordinate = siteData$x_coordinate$Value,\n    y_coordinate = siteData$y_coordinate$Value\n  )\n\n  # combine data ---------------------------------------------------------\n  c_table \u003c- r2q::combine_concentration_tables(\n    threshold_table = c_threshold, \n    storm_table = c_storm, \n    background_table = c_river\n  )\n\n  # process -----------------------------------------------------------------\n  r2q_h \u003c- r2q::hydrology_assessment(site_data = siteData, q_rain = rain[2])\n  c_type \u003c- \"average\" # --\u003e median or \"worstcase\" -\u003e 95th Quantile\n\n  # which substance poses a high risk?\n  checked \u003c- r2q::check_all_substances(\n    c_table = c_table, \n    c_type = c_type)\n\n  # Assessment of one substance\n    r2q::immission_assessment(\n      site_data = siteData, \n      c_table = c_table, \n      q_rain = rain[2], \n      t_rain = rain[1] * 60, substance = \"Zink_geloest\", \n      hazard_list = checked)\n\n  # Assessment of all substances of potentially high risk\n  r2q_out \u003c- r2q::assess_all_hazards(\n    hazard_list = checked, \n    site_data = siteData, \n    c_table = c_table, \n    q_rain = rain[2], t_rain = rain[1] * 60, \n    c_type = c_type)\n\n  # plot the results\n  r2q::plot_hazards(hazards = checked) # substances that might pose a high risk\n\n  r2q::plot_connectable_urban_area(\n    r2q_substance = r2q_out, \n    r2q_hydrology = r2q_h, \n    site_data = siteData, \n    x_type = \"percent\", \n    language = \"de\"\n  )\n\n  # detailed planning (excel sheet: \"planning_area_details\") ------------------\n  planningData \u003c- r2q::load_planning_details(\n    data.dir = path, \n    filename = fileName,\n    scenario_name = \"planning_area_details\" # excel sheet name of planning details\n  )\n\n  pl_out \u003c- r2q::planning_area_discharge(\n    planning_data = planningData, \n    q_rain = rain[2], \n    t_rain = rain[1] * 60, \n    y_rain = siteData$rain_year$Value, \n    thresholdTable = c_threshold)\n\n  # comparison with tolerable discharge\n  isPlan \u003c- data.frame(\n    \"loadPlan_is\" = pl_out$sum)\n  isPlan$substance \u003c- rownames(isPlan)\n  df_compare \u003c- merge(\n    x = isPlan, \n    y = as.data.frame(lapply(r2q_out$general, unlist)), \n    by = \"substance\", \n    all.y = TRUE)\n  df_compare\n  ```\n\u003c/details\u003e\n\n## Documentation\n\nRelease: [https://kwb-r.github.io/r2q](https://kwb-r.github.io/r2q)\n\nDevelopment: [https://kwb-r.github.io/r2q/dev](https://kwb-r.github.io/r2q/dev)\n\n## Documentation\n\nRelease: [https://kwb-r.github.io/r2q](https://kwb-r.github.io/r2q)\n\nDevelopment: [https://kwb-r.github.io/r2q/dev](https://kwb-r.github.io/r2q/dev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwb-r%2Fr2q","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwb-r%2Fr2q","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwb-r%2Fr2q/lists"}