{"id":300007,"name":"SSN2","description":"An R package for spatial statistical modeling and prediction on stream networks, including models based on in-stream distance.","url":"https://github.com/usepa/ssn2","last_synced_at":"2026-04-19T23:02:36.822Z","repository":{"id":203362187,"uuid":"707875440","full_name":"USEPA/SSN2","owner":"USEPA","description":"SSN2: Spatial Modeling on Stream Networks in R","archived":false,"fork":false,"pushed_at":"2025-11-13T19:03:17.000Z","size":34121,"stargazers_count":25,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-03-30T13:03:05.759Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://usepa.github.io/SSN2/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/USEPA.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-10-20T21:36:20.000Z","updated_at":"2025-12-12T00:18:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"5428dc11-a44b-4938-9201-dfb45c3dc19e","html_url":"https://github.com/USEPA/SSN2","commit_stats":{"total_commits":110,"total_committers":3,"mean_commits":"36.666666666666664","dds":"0.24545454545454548","last_synced_commit":"ab39f126e2c66bd2a8a11123faf251e26cf7c796"},"previous_names":["usepa/ssn2"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/USEPA/SSN2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/USEPA","download_url":"https://codeload.github.com/USEPA/SSN2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31359104,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T14:24:47.623Z","status":"ssl_error","status_checked_at":"2026-04-03T14:24:32.380Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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"}},"owner":{"login":"USEPA","name":"U.S. Environmental Protection Agency","uuid":"1304320","kind":"organization","description":"","email":null,"website":"https://www.epa.gov","location":"United States of America","twitter":"EPA","company":null,"icon_url":"https://avatars.githubusercontent.com/u/1304320?v=4","repositories_count":449,"last_synced_at":"2024-04-14T19:47:37.473Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/USEPA","funding_links":[],"total_stars":2868,"followers":360,"following":0,"created_at":"2022-11-03T23:38:50.125Z","updated_at":"2024-04-14T19:49:15.808Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/USEPA","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/USEPA/repositories"},"packages":[{"id":8559978,"name":"SSN2","ecosystem":"cran","description":"Spatial Modeling on Stream Networks","homepage":"https://usepa.github.io/SSN2/","licenses":"GPL-3","normalized_licenses":["GPL-3.0"],"repository_url":"https://github.com/usepa/SSN2","keywords_array":[],"namespace":null,"versions_count":7,"first_release_published_at":"2023-11-08T00:00:00.000Z","latest_release_published_at":"2025-10-21T00:00:00.000Z","latest_release_number":"0.4.0","last_synced_at":"2026-04-17T22:00:49.509Z","created_at":"2023-11-08T19:08:31.569Z","updated_at":"2026-04-17T22:00:49.510Z","registry_url":"https://cran.r-project.org/package=SSN2","install_command":null,"documentation_url":"http://cran.r-project.org/web/packages/SSN2/SSN2.pdf","metadata":{},"repo_metadata":{"id":203362187,"uuid":"707875440","full_name":"USEPA/SSN2","owner":"USEPA","description":"SSN2: Spatial Modeling on Stream Networks in R","archived":false,"fork":false,"pushed_at":"2024-10-11T17:36:41.000Z","size":12880,"stargazers_count":13,"open_issues_count":1,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-10-29T21:00:07.498Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://usepa.github.io/SSN2/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/USEPA.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","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}},"created_at":"2023-10-20T21:36:20.000Z","updated_at":"2024-09-29T21:14:45.000Z","dependencies_parsed_at":null,"dependency_job_id":"5428dc11-a44b-4938-9201-dfb45c3dc19e","html_url":"https://github.com/USEPA/SSN2","commit_stats":null,"previous_names":["usepa/ssn2"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/USEPA","download_url":"https://codeload.github.com/USEPA/SSN2/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222149603,"owners_count":16939361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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"},"owner_record":{"login":"USEPA","name":"U.S. Environmental Protection Agency","uuid":"1304320","kind":"organization","description":"","email":null,"website":"https://www.epa.gov","location":"United States of America","twitter":"EPA","company":null,"icon_url":"https://avatars.githubusercontent.com/u/1304320?v=4","repositories_count":449,"last_synced_at":"2024-04-14T19:47:37.473Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/USEPA","funding_links":[],"total_stars":2868,"followers":360,"following":0,"created_at":"2022-11-03T23:38:50.125Z","updated_at":"2024-04-14T19:49:15.808Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/USEPA","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/USEPA/repositories"},"tags":[{"name":"v0.2.1","sha":"ab39f126e2c66bd2a8a11123faf251e26cf7c796","kind":"commit","published_at":"2024-08-28T18:01:19.000Z","download_url":"https://codeload.github.com/USEPA/SSN2/tar.gz/v0.2.1","html_url":"https://github.com/USEPA/SSN2/releases/tag/v0.2.1","dependencies_parsed_at":null,"dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags/v0.2.1","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags/v0.2.1/manifests"},{"name":"v0.2.0","sha":"6ba05e976f8a20b860c436b10a3738659849ff24","kind":"commit","published_at":"2024-07-26T23:24:18.000Z","download_url":"https://codeload.github.com/USEPA/SSN2/tar.gz/v0.2.0","html_url":"https://github.com/USEPA/SSN2/releases/tag/v0.2.0","dependencies_parsed_at":null,"dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags/v0.2.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags/v0.2.0/manifests"},{"name":"v0.2.0(JOSS)","sha":"c7186aa27579565cf3e14b2df359a053ba48b76f","kind":"commit","published_at":"2024-07-15T18:36:32.000Z","download_url":"https://codeload.github.com/USEPA/SSN2/tar.gz/v0.2.0(JOSS)","html_url":"https://github.com/USEPA/SSN2/releases/tag/v0.2.0(JOSS)","dependencies_parsed_at":null,"dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags/v0.2.0(JOSS)","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags/v0.2.0(JOSS)/manifests"},{"name":"v0.1.1","sha":"6b634c5ac1ce66195db5cbdec6c9ac3d10bee46a","kind":"commit","published_at":"2024-01-15T22:32:16.000Z","download_url":"https://codeload.github.com/USEPA/SSN2/tar.gz/v0.1.1","html_url":"https://github.com/USEPA/SSN2/releases/tag/v0.1.1","dependencies_parsed_at":null,"dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags/v0.1.1","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags/v0.1.1/manifests"},{"name":"v0.1.0","sha":"b387ca4813a40c5beb46f8c1be85b11686688a31","kind":"commit","published_at":"2023-11-06T15:53:51.000Z","download_url":"https://codeload.github.com/USEPA/SSN2/tar.gz/v0.1.0","html_url":"https://github.com/USEPA/SSN2/releases/tag/v0.1.0","dependencies_parsed_at":null,"dependency_job_id":null,"tag_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags/v0.1.0","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/USEPA%2FSSN2/tags/v0.1.0/manifests"}]},"repo_metadata_updated_at":"2024-11-11T05:55:58.437Z","dependent_packages_count":1,"downloads":613,"downloads_period":"last-month","dependent_repos_count":0,"rankings":{"downloads":86.55616120096506,"dependent_repos_count":36.90018765079082,"dependent_packages_count":28.87846291331546,"stargazers_count":30.957594173108717,"forks_count":27.899910634495086,"docker_downloads_count":null,"average":42.238463314535025},"purl":"pkg:cran/SSN2","advisories":[],"docker_usage_url":"https://docker.ecosyste.ms/usage/cran/SSN2","docker_dependents_count":null,"docker_downloads_count":null,"usage_url":"https://repos.ecosyste.ms/usage/cran/SSN2","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/cran/SSN2/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2024-11-11T04:30:23.238Z","issues_count":22,"pull_requests_count":13,"avg_time_to_close_issue":3187302.6666666665,"avg_time_to_close_pull_request":29512.53846153846,"issues_closed_count":21,"pull_requests_closed_count":13,"pull_request_authors_count":2,"issue_authors_count":7,"avg_comments_per_issue":2.1363636363636362,"avg_comments_per_pull_request":0.3076923076923077,"merged_pull_requests_count":13,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":20,"past_year_pull_requests_count":13,"past_year_avg_time_to_close_issue":3460232.4736842103,"past_year_avg_time_to_close_pull_request":29512.53846153846,"past_year_issues_closed_count":19,"past_year_pull_requests_closed_count":13,"past_year_pull_request_authors_count":2,"past_year_issue_authors_count":6,"past_year_avg_comments_per_issue":2.15,"past_year_avg_comments_per_pull_request":0.3076923076923077,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":13,"issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/usepa%2Fssn2/issues","maintainers":[{"login":"michaeldumelle","count":11,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/michaeldumelle"},{"login":"jhollist","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/jhollist"}],"active_maintainers":[{"login":"michaeldumelle","count":11,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/michaeldumelle"},{"login":"jhollist","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/jhollist"}]},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/SSN2/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/SSN2/version_numbers","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/SSN2/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/SSN2/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages/SSN2/codemeta","maintainers":[{"uuid":"Dumelle.Michael@epa.gov","login":null,"name":"Michael Dumelle","email":"Dumelle.Michael@epa.gov","url":null,"packages_count":3,"html_url":null,"role":null,"created_at":"2023-11-08T19:09:10.523Z","updated_at":"2023-11-08T19:09:10.523Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/maintainers/Dumelle.Michael@epa.gov/packages"}],"registry":{"name":"cran.r-project.org","url":"https://cran.r-project.org","ecosystem":"cran","default":true,"packages_count":28010,"maintainers_count":15530,"namespaces_count":0,"keywords_count":0,"github":"r-project-org","metadata":{"icon_url":"https://cran.r-project.org/CRANlogo.png","funded_packages_count":546},"icon_url":"https://cran.r-project.org/CRANlogo.png","created_at":"2022-04-06T16:32:25.637Z","updated_at":"2026-04-03T06:40:33.945Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/packages","maintainers_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/maintainers","namespaces_url":"https://packages.ecosyste.ms/api/v1/registries/cran.r-project.org/namespaces"}}],"commits":{"id":1739637,"full_name":"usepa/ssn2","default_branch":"main","total_commits":183,"total_committers":2,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":91.5,"dds":0.14754098360655743,"past_year_total_commits":61,"past_year_total_committers":2,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":30.5,"past_year_dds":0.1311475409836066,"last_synced_at":"2026-04-16T22:24:20.201Z","last_synced_commit":"d454f61dc877cafc570434ee819ebe4285406766","created_at":"2024-09-12T00:11:38.102Z","updated_at":"2026-04-16T22:24:20.145Z","committers":[{"name":"Michael Dumelle","email":"mjdumelle@gmail.com","login":"michaeldumelle","count":156},{"name":"pet221","email":"erin@peterson-consulting.com","login":"pet221","count":27}],"past_year_committers":[{"name":"Michael Dumelle","email":"Dumelle.Michael@epa.gov","login":"michaeldumelle","count":53},{"name":"pet221","email":"erin@peterson-consulting.com","login":"pet221","count":8}],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/usepa%2Fssn2/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-19T00:00:13.908Z","repositories_count":6214529,"commits_count":900194407,"contributors_count":34915600,"owners_count":1143537,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"usepa/ssn2","html_url":"https://github.com/usepa/ssn2","last_synced_at":"2026-03-30T13:00:26.885Z","status":"error","issues_count":17,"pull_requests_count":17,"avg_time_to_close_issue":5806996.0,"avg_time_to_close_pull_request":25573.8,"issues_closed_count":13,"pull_requests_closed_count":15,"pull_request_authors_count":3,"issue_authors_count":10,"avg_comments_per_issue":1.647058823529412,"avg_comments_per_pull_request":0.11764705882352941,"merged_pull_requests_count":15,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":4,"past_year_pull_requests_count":5,"past_year_avg_time_to_close_issue":645058.0,"past_year_avg_time_to_close_pull_request":14.75,"past_year_issues_closed_count":1,"past_year_pull_requests_closed_count":4,"past_year_pull_request_authors_count":2,"past_year_issue_authors_count":4,"past_year_avg_comments_per_issue":0.75,"past_year_avg_comments_per_pull_request":0.0,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":4,"created_at":"2024-09-12T00:11:40.305Z","updated_at":"2026-03-30T13:00:26.885Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/usepa%2Fssn2","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/usepa%2Fssn2/issues","issue_labels_count":{},"pull_request_labels_count":{},"issue_author_associations_count":{"NONE":17},"pull_request_author_associations_count":{"COLLABORATOR":14,"MEMBER":2,"NONE":1},"issue_authors":{"fawda123":6,"katiewampler":2,"k-doering-NOAA":2,"niallgclancy":1,"highamm":1,"Fang":1,"KGBrennan":1,"messamat":1,"daauerbach":1,"fernandomayer":1},"pull_request_authors":{"michaeldumelle":14,"jhollist":2,"milliyin":1},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-09T00:00:10.509Z","repositories_count":14210836,"issues_count":34657220,"pull_requests_count":113242396,"authors_count":11232570,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{"NONE":2},"past_year_pull_request_author_associations_count":{"COLLABORATOR":4},"past_year_issue_authors":{"Fang":1,"messamat":1},"past_year_pull_request_authors":{"michaeldumelle":4},"maintainers":[{"login":"michaeldumelle","count":14,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/michaeldumelle"},{"login":"jhollist","count":2,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/jhollist"}],"active_maintainers":[{"login":"michaeldumelle","count":4,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/michaeldumelle"}]},"events":{"total":{"ReleaseEvent":3,"DeleteEvent":2,"PullRequestEvent":4,"ForkEvent":4,"IssuesEvent":7,"WatchEvent":8,"IssueCommentEvent":10,"PushEvent":50,"CreateEvent":5},"last_year":{"ReleaseEvent":3,"DeleteEvent":2,"PullRequestEvent":3,"ForkEvent":1,"IssuesEvent":4,"WatchEvent":3,"IssueCommentEvent":6,"PushEvent":37,"CreateEvent":4}},"keywords":[],"dependencies":[],"score":10.333645273234664,"created_at":"2024-09-12T00:11:34.554Z","updated_at":"2026-04-19T23:02:36.844Z","avatar_url":"https://github.com/USEPA.png","language":"R","category":"Hydrosphere","sub_category":"Ocean Models","monthly_downloads":613,"total_dependent_repos":0,"total_dependent_packages":1,"readme":"\u003c!-- badges: start --\u003e\n[![CRAN](http://www.r-pkg.org/badges/version/SSN2)](https://cran.r-project.org/package=SSN2)\n[![cran checks](https://badges.cranchecks.info/worst/SSN2.svg)](https://cran.r-project.org/web/checks/check_results_SSN2.html)\n[![R-CMD-check](https://github.com/USEPA/SSN2/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/USEPA/SSN2/actions/workflows/R-CMD-check.yaml)\n[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![status](https://joss.theoj.org/papers/10.21105/joss.06389/status.svg)](https://joss.theoj.org/papers/10.21105/joss.06389)\n\u003c!-- badges: end --\u003e\n\n# SSN2: Spatial Modeling on Stream Networks\n\n`SSN2` is an R package for spatial statistical modeling and prediction on\nstream networks, including models based on in-stream distance.\nModels are created using moving average constructions. Spatial linear models,\nincluding explanatory variables, can be fit with (restricted) maximum likelihood.\nMapping and other graphical functions are included. It is the successor to the `SSN` R package. See the `SSN2` website for more: [https://usepa.github.io/SSN2/](https://usepa.github.io/SSN2/).\n\n## Citation\n\nIf you use `SSN2` in a formal publication or report, please cite it. Citing `SSN2` lets us devote more resources to it in the future. View the `SSN2` citation by running\n```r\ncitation(package = \"SSN2\")\n```\n\n```\n#\u003e \n#\u003e To cite SSN2 in publications use:\n#\u003e \n#\u003e   Dumelle M, Peterson EE, Ver Hoef JM, Pearse A, Isaak DJ (2024). SSN2:\n#\u003e   The next generation of spatial stream network modeling in R. Journal\n#\u003e   of Open Source Software, 9(99), 6389,\n#\u003e   https://doi.org/10.21105/joss.06389\n#\u003e \n#\u003e A BibTeX entry for LaTeX users is\n#\u003e \n#\u003e   @Article{,\n#\u003e     title = {{SSN2}: The next generation of spatial stream network modeling in {R}},\n#\u003e     author = {Michael Dumelle and Erin E. Peterson and Jay M. {Ver Hoef} and Alan Pearse and Daniel J. Isaak},\n#\u003e     journal = {Journal of Open Source Software},\n#\u003e     year = {2024},\n#\u003e     volume = {9},\n#\u003e     number = {99},\n#\u003e     pages = {6389},\n#\u003e     doi = {10.21105/joss.06389},\n#\u003e     url = {https://doi.org/10.21105/joss.06389},\n#\u003e     publisher = {The Open Journal},\n#\u003e   }\n```\n\n## Statement of Need\n\nStreams provide vital aquatic services that sustain wildlife, provide drinking and irrigation water, and support recreational and cultural activities.  Data are often collected at various locations on a stream network and used to characterize spatial patterns in stream phenomena. For example, a manager may need to know how the amount of a hazardous chemical changes throughout a stream network to inform mitigation efforts. Comprehensive formulations of spatial stream network (SSN) models are provided by references in [this article](https://doi.org/10.21105/joss.06389). The `SSN2` **R** package is designed to help users fit SSN models to their stream network data.\n\nSSN models use a spatial statistical modeling framework to describe unique and complex dependencies on a stream network resulting from a branching network structure, directional water flow, and differences in flow volume. These SSN models relate a continuous or discrete response variable to one or more explanatory variables, a spatially independent random error term, and up to three spatially dependent random error terms: tail-up random errors, tail-down random errors, and Euclidean random errors. Tail-up random errors restrict spatial dependence to flow-connected sites (i.e., water flows from an upstream to a downstream site) and incorporate spatial weights through an additive function to describe the branching network between sites. Tail-down random errors describe spatial dependence between both flow-connected and flow-unconnected sites (i.e., sites that share a common downstream junction but not flow), but spatial weights are not required. Euclidean random errors describe spatial dependence between sites based on straight-line distance and are governed by factors not confined to the stream network, such as regional geology. The variances and the length-scales of spatial dependence in the tail-up, tail-down, and Euclidean random errors are controlled by separate variance (i.e., partial sill) and range parameters, respectively, while the spatially independent variance (i.e., nugget) is controlled by another separate variance parameter. Here we briefly show how to use the `SSN2` **R** package to fit SSN models, inspect SSN models, and use SSN models to make predictions at unobserved locations on a stream network. To learn more, visit [our website](https://usepa.github.io/SSN2/). \n\n\n## Installation Instructions\n\nInstall and load the most recent approved version from CRAN by running\n```r\n# install the most recent approved version from CRAN\ninstall.packages(\"SSN2\")\n# load the most recent approved version from CRAN\nlibrary(SSN2)\n```\n\nInstall and load the most recent version of`SSN2` from GitHub by running\n```r\n# Installing from GitHub requires you first install the remotes package\ninstall.packages(\"remotes\")\n\n# install the most recent version from GitHub\nremotes::install_github(\"USEPA/SSN2\", ref = \"main\")\n# load the most recent development version from GitHub\nlibrary(SSN2)\n```\n\nInstall and load the most recent development version of`SSN2` from GitHub by running\n```r\n# Installing from GitHub requires you first install the remotes package\ninstall.packages(\"remotes\")\n\n# install the most recent version from GitHub\nremotes::install_github(\"USEPA/SSN2\", ref = \"develop\")\n# load the most recent development version from GitHub\nlibrary(SSN2)\n```\n\n## Contributing to `SSN2`\n\nWe encourage users to report bugs and/or contribute to `SSN2`. For more detail on how to do this, please see our contributing guide (`CONTRIBUTING.md`).\n\n## Getting Help\n\nThere are several ways to get help with `SSN2`:\n\n1. Open a GitHub issue [link here](https://github.com/USEPA/SSN2/issues).\n2. Email the SSN support team (support@spatialstreamnetworks.com or Dumelle.Michael@epa.gov)\n3. Post on a support website like Stack Overflow or Cross Validated. \n\n## Example Usage\n\nBelow we provide a brief example showing how to use `SSN2`. For a thorough introduction to the software, see our introductory vignette [linked here](https://usepa.github.io/SSN2/articles/introduction.html). For a list of all functions available in `SSN2`, see our function reference [linked here](https://usepa.github.io/SSN2/reference/index.html).\n\nWe load `SSN2`, copy the `.ssn` object that comes with `SSN2` to the temporary directory, and create stream distance matrices used for modeling by running\n\n```r\nlibrary(SSN2)\ncopy_lsn_to_temp()\npath \u003c- paste0(tempdir(), \"/MiddleFork04.ssn\")\nmf04p \u003c- ssn_import(path, predpts = \"pred1km\")\nssn_create_distmat(mf04p, predpts = \"pred1km\", overwrite = TRUE)\n```\n\nWe fit and summarize an SSN model explaining summer water temperature (`Summer_mn`) as a function of elevation (`ELEV_DEM`) and precipitation (`AREAWTMAP`) with a exponential, spherical, and Gaussian structures for the tail-up, tail-down, and Euclidean errors, respectively, by running\n\n```r\nssn_mod \u003c- ssn_lm(\n  formula = Summer_mn ~ ELEV_DEM + AREAWTMAP,\n  ssn.object = mf04p,\n  tailup_type = \"exponential\",\n  taildown_type = \"spherical\",\n  euclid_type = \"gaussian\",\n  additive = \"afvArea\"\n)\nsummary(ssn_mod)\n```\n\n```\n#\u003e \n#\u003e Call:\n#\u003e ssn_lm(formula = Summer_mn ~ ELEV_DEM + AREAWTMAP, ssn.object = mf04p, \n#\u003e     tailup_type = \"exponential\", taildown_type = \"spherical\", \n#\u003e     euclid_type = \"gaussian\", additive = \"afvArea\")\n#\u003e \n#\u003e Residuals:\n#\u003e     Min      1Q  Median      3Q     Max \n#\u003e -3.6393 -2.0646 -0.5952  0.2143  0.7497 \n#\u003e \n#\u003e Coefficients (fixed):\n#\u003e              Estimate Std. Error z value Pr(\u003e|z|)    \n#\u003e (Intercept) 76.195041   7.871574   9.680  \u003c 2e-16 ***\n#\u003e ELEV_DEM    -0.026905   0.003646  -7.379  1.6e-13 ***\n#\u003e AREAWTMAP   -0.009099   0.004461  -2.040   0.0414 *  \n#\u003e ---\n#\u003e Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1\n#\u003e \n#\u003e Pseudo R-squared: 0.6124\n#\u003e \n#\u003e Coefficients (covariance):\n#\u003e               Effect     Parameter   Estimate\n#\u003e   tailup exponential  de (parsill)  3.800e+00\n#\u003e   tailup exponential         range  4.194e+06\n#\u003e   taildown spherical  de (parsill)  4.480e-01\n#\u003e   taildown spherical         range  1.647e+05\n#\u003e      euclid gaussian  de (parsill)  1.509e-02\n#\u003e      euclid gaussian         range  4.496e+03\n#\u003e \n```\n\nWe tidy, glance at, and augment (with diagnostics) the fitted model by running\n\n```r\ntidy(ssn_mod, conf.int = TRUE)\n```\n\n```\n#\u003e # A tibble: 3 × 7\n#\u003e   term        estimate std.error statistic  p.value conf.low conf.high\n#\u003e   \u003cchr\u003e          \u003cdbl\u003e     \u003cdbl\u003e     \u003cdbl\u003e    \u003cdbl\u003e    \u003cdbl\u003e     \u003cdbl\u003e\n#\u003e 1 (Intercept) 76.2       7.87         9.68 0         60.8    91.6     \n#\u003e 2 AREAWTMAP   -0.00910   0.00446     -2.04 4.14e- 2  -0.0178 -0.000356\n#\u003e 3 ELEV_DEM    -0.0269    0.00365     -7.38 1.60e-13  -0.0341 -0.0198\n```\n\n```r\nglance(ssn_mod)\n```\n\n```\n#\u003e # A tibble: 1 × 9\n#\u003e       n     p  npar value   AIC  AICc logLik deviance pseudo.r.squared\n#\u003e   \u003cint\u003e \u003cdbl\u003e \u003cint\u003e \u003cdbl\u003e \u003cdbl\u003e \u003cdbl\u003e  \u003cdbl\u003e    \u003cdbl\u003e            \u003cdbl\u003e\n#\u003e 1    45     3     7  59.3  73.3  76.3  -29.6     41.9            0.612\n```\n\n```r\nhead(augment(ssn_mod))\n```\n\n```\n#\u003e Simple feature collection with 6 features and 9 fields\n#\u003e Geometry type: POINT\n#\u003e Dimension:     XY\n#\u003e Bounding box:  xmin: -1515032 ymin: 2529461 xmax: -1512690 ymax: 2531883\n#\u003e Projected CRS: USA_Contiguous_Albers_Equal_Area_Conic_USGS_version\n#\u003e # A tibble: 6 × 10\n#\u003e   Summer_mn ELEV_DEM AREAWTMAP .fitted .resid   .hat  .cooksd .std.resid pid  \n#\u003e       \u003cdbl\u003e    \u003cint\u003e     \u003cdbl\u003e   \u003cdbl\u003e  \u003cdbl\u003e  \u003cdbl\u003e    \u003cdbl\u003e      \u003cdbl\u003e \u003cchr\u003e\n#\u003e 1     11.4      1977      940.    14.4  -3.07 0.0915 0.0962       -1.78  1    \n#\u003e 2     10.7      1984     1087.    12.9  -2.20 0.114  0.00471      -0.352 2    \n#\u003e 3     10.4      1993     1087.    12.7  -2.25 0.0372 0.00724      -0.764 3    \n#\u003e 4     10.1      2007     1087.    12.3  -2.18 0.0251 0.00153      -0.427 4    \n#\u003e 5     10.1      2009     1087.    12.3  -2.13 0.0374 0.000583     -0.216 5    \n#\u003e 6      9.81     2012     1109.    12.0  -2.16 0.0602 0.0150       -0.863 6    \n#\u003e # ℹ 1 more variable: geometry \u003cPOINT [m]\u003e\n\n```\n\nWe make predictions at the prediction sites (`pred1km`) by running `predict()` (or `augment()`:\n\n```r\npreds \u003c- predict(ssn_mod, newdata = \"pred1km\", interval = \"prediction\")\nhead(preds)\n```\n\n```\n#\u003e        fit      lwr      upr\n#\u003e 1 14.64383 14.27138 15.01627\n#\u003e 2 15.00608 14.65017 15.36198\n#\u003e 3 14.79235 14.27414 15.31057\n#\u003e 4 14.96884 14.45492 15.48276\n#\u003e 5 15.15182 14.73770 15.56595\n#\u003e 6 15.12783 14.76358 15.49208\n```\n\n## Imported Packages\n\n`SSN2` imports the following **R** packages:\n\n* generics: For exporting generic functions.\n* graphics: For visualizations (e.g., `plot()`).\n* Matrix: For efficient matrix manipulations.\n* RSQlite: For various functions that read and write (e.g., `ssn_create_distmat()`).\n* sf: For handling spatial data.\n* spmodel: For various modeling functions (e.g., `randcov_initial()`) and generic functions (e.g., `loocv()`).\n* stats: For various modeling functions (e.g., `confint()`).\n* tibble: For creating tibbles as output for various functions (e.g., `tidy()`).\n* utils: For various utility functions.\n* withr: For path handling while reading and writing.\n\n## Suggested Packages\n\n`SSN2` suggests the following **R** packages:\n\n* ggplot2: For vignette visualizations.\n* knitr: For vignette building.\n* rmarkdown: For vignette building.\n* sp: For making `SSN` objects from the `SSN` **R** package compatible with `SSN2`.\n* statmod: For modeling and simulation of inverse Gaussian data.\n* testthat: For unit testing.\n\n## License\n\nThis project is licensed under the GNU General Public License, [GPL-3](https://cran.r-project.org/web/licenses/GPL-3).\n\n## EPA Disclaimer\n\nThe United States Environmental Protection Agency (EPA) GitHub project code is provided on an \"as is\" basis and the user assumes responsibility for its use. EPA has relinquished control of the information and no longer has responsibility to protect the integrity , confidentiality, or availability of the information. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by EPA. The EPA seal and logo shall not be used in any manner to imply endorsement of any commercial product or activity by EPA or the United States Government.\n\n","funding_links":[],"readme_doi_urls":["https://doi.org/10.21105/joss.06389"],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":[],"project_url":"https://ost.ecosyste.ms/api/v1/projects/300007","html_url":"https://ost.ecosyste.ms/projects/300007"}