From 09d10084e3036d22c30419a899217587a85979d7 Mon Sep 17 00:00:00 2001 From: Michael Dumelle Date: Fri, 16 Aug 2024 08:09:14 -0700 Subject: [PATCH 1/5] update development version number --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 24f5339..170ce7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: SSN2 Title: Spatial Modeling on Stream Networks -Version: 0.2.0 +Version: 0.2.1 Authors@R: c( person(given = "Michael", family = "Dumelle", From a3f2f6691270db789585e1d35d4186a0b6d319d9 Mon Sep 17 00:00:00 2001 From: Michael Dumelle Date: Fri, 16 Aug 2024 08:09:47 -0700 Subject: [PATCH 2/5] enhance stability of deviance in beta regression #23 --- NEWS.md | 6 ++++++ R/get_model_stats_glm.R | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 33c2ec4..aa8f94a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# SSN2 0.2.1 + +## Minor Updates + +* Enhanced numeric stability of deviance and pseudo R-squared for `ssn_glm()` models when `family = "beta"` [(#23)](https://github.com/USEPA/SSN2/issues/23). + # SSN2 0.2.0 ## Major Updates diff --git a/R/get_model_stats_glm.R b/R/get_model_stats_glm.R index 2073c44..1a73774 100644 --- a/R/get_model_stats_glm.R +++ b/R/get_model_stats_glm.R @@ -445,7 +445,9 @@ get_deviance_glm <- function(family, y, fitted_response, size, dispersion) { } else if (family == "inverse.gaussian") { half_deviance_i <- 0.5 * (y - fitted_response)^2 / (y * fitted_response^2) } else if (family == "beta") { - constant <- log(gamma(fitted_response * dispersion)) + log(gamma((1 - fitted_response) * dispersion)) - log(gamma(y * dispersion)) - log(gamma((1 - y) * dispersion)) + # has NA problem for large dispersion + # constant <- log(gamma(fitted_response * dispersion)) + log(gamma((1 - fitted_response) * dispersion)) - log(gamma(y * dispersion)) - log(gamma((1 - y) * dispersion)) + constant <- lgamma(fitted_response * dispersion) + lgamma((1 - fitted_response) * dispersion) - lgamma(y * dispersion) - lgamma((1 - y) * dispersion) half_deviance_i <- constant + (y - fitted_response) * dispersion * log(y) + ((1 - y) - (1 - fitted_response)) * dispersion * log(1 - y) } deviance_i <- 2 * half_deviance_i From 27025b63cafd39841854cab685217063afd6e11b Mon Sep 17 00:00:00 2001 From: Michael Dumelle Date: Tue, 27 Aug 2024 16:02:37 -0700 Subject: [PATCH 3/5] update to fix AIC and AICc link with spmodel v0.8.0 changes --- NEWS.md | 1 + cran-comments.md | 3 ++- man/reexports.Rd | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index aa8f94a..c45ee40 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,6 +3,7 @@ ## Minor Updates * Enhanced numeric stability of deviance and pseudo R-squared for `ssn_glm()` models when `family = "beta"` [(#23)](https://github.com/USEPA/SSN2/issues/23). +* Updated `reexport.Rd` to reflect changes in `spmodel v0.8.0`'s handling of `AIC()` and `AICc()`. # SSN2 0.2.0 diff --git a/cran-comments.md b/cran-comments.md index 759ca03..09be54b 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,4 +1,5 @@ -This is a minor update that adds a few small features and bug fixes. Thank you. +This is a minor update that enhances stability and includes updates to `reexports.Rd` +to reflect changes in `spmodel v0.8.0`'s handling of `AIC()` and `AICc()`. Thank you. ------- diff --git a/man/reexports.Rd b/man/reexports.Rd index 4d86b31..e4197d7 100644 --- a/man/reexports.Rd +++ b/man/reexports.Rd @@ -25,6 +25,6 @@ below to see their documentation. \describe{ \item{generics}{\code{\link[generics]{augment}}, \code{\link[generics]{glance}}, \code{\link[generics]{tidy}}} - \item{spmodel}{\code{\link[spmodel:AIC.spmodel]{AICc}}, \code{\link[spmodel]{covmatrix}}, \code{\link[spmodel]{dispersion_initial}}, \code{\link[spmodel]{dispersion_params}}, \code{\link[spmodel]{glances}}, \code{\link[spmodel]{loocv}}, \code{\link[spmodel]{pseudoR2}}, \code{\link[spmodel]{randcov_initial}}, \code{\link[spmodel]{randcov_params}}, \code{\link[spmodel]{varcomp}}} + \item{spmodel}{\code{\link[spmodel]{AICc}}, \code{\link[spmodel]{covmatrix}}, \code{\link[spmodel]{dispersion_initial}}, \code{\link[spmodel]{dispersion_params}}, \code{\link[spmodel]{glances}}, \code{\link[spmodel]{loocv}}, \code{\link[spmodel]{pseudoR2}}, \code{\link[spmodel]{randcov_initial}}, \code{\link[spmodel]{randcov_params}}, \code{\link[spmodel]{varcomp}}} }} From fe4ccc85373b22be35f773619a66c6bee8a5e3ca Mon Sep 17 00:00:00 2001 From: Michael Dumelle Date: Tue, 27 Aug 2024 17:20:58 -0700 Subject: [PATCH 4/5] update JOSS badge link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index da72cda..0b9c775 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![cran checks](https://badges.cranchecks.info/worst/SSN2.svg)](https://cran.r-project.org/web/checks/check_results_SSN2.html) [![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) [![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) -[![status](https://joss.theoj.org/papers/66fd932526762f8ccd8bd9c3954e0e3d/status.svg)](https://joss.theoj.org/papers/66fd932526762f8ccd8bd9c3954e0e3d) +[![status](https://joss.theoj.org/papers/10.21105/joss.06389/status.svg)](https://joss.theoj.org/papers/10.21105/joss.06389) # SSN2: Spatial Modeling on Stream Networks From 20850c15729ff109a9682ff190627145758c4e39 Mon Sep 17 00:00:00 2001 From: Michael Dumelle Date: Wed, 28 Aug 2024 10:56:37 -0700 Subject: [PATCH 5/5] website updates; downgrade to pkgdown 2.0.9 and boostrap 3 for toc --- _pkgdown.yml | 4 +- docs/404.html | 126 ++-- docs/CONTRIBUTING.html | 105 ++-- docs/LICENSE.html | 99 +-- docs/articles/index.html | 101 ++-- docs/articles/introduction.html | 316 +++++----- docs/authors.html | 135 +++-- docs/bootstrap-toc.css | 60 ++ docs/bootstrap-toc.js | 159 +++++ docs/docsearch.css | 148 +++++ docs/docsearch.js | 85 +++ docs/index.html | 182 +++--- docs/news/index.html | 119 ++-- docs/pkgdown.css | 384 ++++++++++++ docs/pkgdown.js | 176 ++---- docs/pkgdown.yml | 8 +- docs/reference/AIC.SSN2.html | 164 ++--- docs/reference/MiddleFork04.ssn.html | 127 ++-- docs/reference/SSN2-package.html | 124 ++-- docs/reference/SSN_to_SSN2.html | 138 +++-- docs/reference/Torgegram.html | 161 ++--- docs/reference/anova.SSN2.html | 167 +++--- docs/reference/augment.SSN2.html | 176 +++--- docs/reference/coef.SSN2.html | 149 +++-- docs/reference/confint.SSN2.html | 147 +++-- docs/reference/cooks.distance.SSN2.html | 151 +++-- docs/reference/copy_lsn_to_temp.html | 134 +++-- docs/reference/covmatrix.SSN2.html | 138 +++-- docs/reference/create_netgeom.html | 145 +++-- docs/reference/deviance.SSN2.html | 144 +++-- docs/reference/fitted.SSN2.html | 153 +++-- docs/reference/formula.SSN2.html | 142 +++-- docs/reference/glance.SSN2.html | 144 +++-- docs/reference/glances.SSN2.html | 147 +++-- docs/reference/hatvalues.SSN2.html | 151 +++-- docs/reference/index.html | 661 +++++++++------------ docs/reference/influence.SSN2.html | 151 +++-- docs/reference/labels.SSN2.html | 140 +++-- docs/reference/logLik.SSN2.html | 140 +++-- docs/reference/loocv.SSN2.html | 153 +++-- docs/reference/mf04p.html | 127 ++-- docs/reference/model.frame.SSN2.html | 144 +++-- docs/reference/model.matrix.SSN2.html | 144 +++-- docs/reference/plot.SSN2.html | 154 +++-- docs/reference/plot.Torgegram.html | 146 +++-- docs/reference/predict.SSN2.html | 166 +++--- docs/reference/print.SSN.html | 134 +++-- docs/reference/print.SSN2.html | 148 +++-- docs/reference/pseudoR2.SSN2.html | 146 +++-- docs/reference/reexports.html | 125 ++-- docs/reference/residuals.SSN2.html | 159 ++--- docs/reference/ssn_create_distmat.html | 150 +++-- docs/reference/ssn_get_data.html | 148 +++-- docs/reference/ssn_get_netgeom.html | 136 +++-- docs/reference/ssn_get_stream_distmat.html | 151 +++-- docs/reference/ssn_glm.html | 198 +++--- docs/reference/ssn_import.html | 153 +++-- docs/reference/ssn_import_predpts.html | 144 +++-- docs/reference/ssn_initial.html | 171 +++--- docs/reference/ssn_lm.html | 194 +++--- docs/reference/ssn_names.html | 133 +++-- docs/reference/ssn_params.html | 164 ++--- docs/reference/ssn_put_data.html | 152 +++-- docs/reference/ssn_simulate.html | 183 +++--- docs/reference/ssn_split_predpts.html | 161 ++--- docs/reference/ssn_subset.html | 149 +++-- docs/reference/ssn_update_path.html | 145 +++-- docs/reference/ssn_write.html | 145 +++-- docs/reference/summary.SSN.html | 138 +++-- docs/reference/summary.SSN2.html | 148 +++-- docs/reference/tidy.SSN2.html | 150 +++-- docs/reference/varcomp.SSN2.html | 143 +++-- docs/reference/vcov.SSN2.html | 142 +++-- docs/sitemap.xml | 272 ++++++--- 74 files changed, 6925 insertions(+), 4592 deletions(-) create mode 100644 docs/bootstrap-toc.css create mode 100644 docs/bootstrap-toc.js create mode 100644 docs/docsearch.css create mode 100644 docs/docsearch.js create mode 100644 docs/pkgdown.css diff --git a/_pkgdown.yml b/_pkgdown.yml index d71acfb..1069461 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: ~ +url: https://usepa.github.io/SSN2/ template: - bootstrap: 5 + bootstrap: 3 diff --git a/docs/404.html b/docs/404.html index dbe33f7..70fc951 100644 --- a/docs/404.html +++ b/docs/404.html @@ -4,78 +4,112 @@ - + Page not found (404) • SSN2 - - - - - + + + + + + + - - Skip to contents - - -
-
-
+ -

Page not found (404)

+ +
+
+ Content not found. Please use links in the navbar. -
-
+
+ -
-
+ + + diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index e79a6c5..7f50c97 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -1,39 +1,59 @@ -Contributing to SSN2 development • SSN2 - Skip to contents - - -
-
-
+
+
+ + + +
+
+
@@ -53,23 +73,30 @@

GitHub Pull Request

+
+ -
+ + diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 5dbd091..e289cbf 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -1,39 +1,59 @@ -GNU General Public License • SSN2 - Skip to contents +GNU General Public License • SSN2 + +
+
-
-
-
+
+
@@ -220,23 +240,30 @@

How to Apply These Terms

-
+
+ -
- +
+

Site built with pkgdown 2.0.9.

+
+
+ + diff --git a/docs/articles/index.html b/docs/articles/index.html index 793cb48..d1faf46 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,63 +1,86 @@ -Articles • SSN2 - Skip to contents - - -
-
-
+
+
+ + + + + -
- +
+ + diff --git a/docs/articles/introduction.html b/docs/articles/introduction.html index f31929d..d04f4a1 100644 --- a/docs/articles/introduction.html +++ b/docs/articles/introduction.html @@ -4,65 +4,89 @@ - + An Introduction to Spatial Stream Network Modeling in R Using SSN2 • SSN2 - - - - - + + + + + + + + - - Skip to contents - - -
- - - + +
+ -
-
+ + diff --git a/docs/authors.html b/docs/authors.html index c27d9b7..d01ea77 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,71 +1,94 @@ -Authors and Citation • SSN2 - Skip to contents - - -
-
-
+
-
- +
+

Site built with pkgdown 2.0.9.

+
+
+ + diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/docsearch.css b/docs/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/docs/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docs/docsearch.js b/docs/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docs/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/docs/index.html b/docs/index.html index a16e903..085c599 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,75 +4,101 @@ - + Spatial Modeling on Stream Networks • SSN2 - - - - - - + + + + + + + - - Skip to contents + + +
    +
    +
    -
    -
    -
    -
    -

    SSN2 is an R package for spatial statistical modeling and prediction on stream networks, including models based on in-stream distance. Models are created using moving average constructions. Spatial linear models, including explanatory variables, can be fit with (restricted) maximum likelihood. Mapping 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/.

    +

    SSN2 is an R package for spatial statistical modeling and prediction on stream networks, including models based on in-stream distance. Models are created using moving average constructions. Spatial linear models, including explanatory variables, can be fit with (restricted) maximum likelihood. Mapping 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/.

    Citation

    If 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

     citation(package = "SSN2")
    -
    #>
    +
    #> 
     #> To cite SSN2 in publications use:
    -#>
    +#> 
     #>   Dumelle M, Peterson EE, Ver Hoef JM, Pearse A, Isaak DJ (2024). SSN2:
     #>   The next generation of spatial stream network modeling in R. Journal
     #>   of Open Source Software, 9(99), 6389,
     #>   https://doi.org/10.21105/joss.06389
    -#>
    +#> 
     #> A BibTeX entry for LaTeX users is
    -#>
    +#> 
     #>   @Article{,
     #>     title = {{SSN2}: The next generation of spatial stream network modeling in {R}},
     #>     author = {Michael Dumelle and Erin E. Peterson and Jay M. {Ver Hoef} and Alan Pearse and Daniel J. Isaak},
    @@ -99,7 +125,7 @@ 

    Installation Instructions# install the most recent approved version from CRAN install.packages("SSN2") # load the most recent approved version from CRAN -library(SSN2)

    +library(SSN2)

    Install and load the most recent version ofSSN2 from GitHub by running

     # Installing from GitHub requires you first install the remotes package
    @@ -108,7 +134,7 @@ 

    Installation Instructions# install the most recent version from GitHub remotes::install_github("USEPA/SSN2", ref = "main") # load the most recent development version from GitHub -library(SSN2)

    +library(SSN2)

    Install and load the most recent development version ofSSN2 from GitHub by running

     # Installing from GitHub requires you first install the remotes package
    @@ -117,7 +143,7 @@ 

    Installation Instructions# install the most recent version from GitHub remotes::install_github("USEPA/SSN2", ref = "develop") # load the most recent development version from GitHub -library(SSN2)

    +library(SSN2)

    Contributing to SSN2 @@ -138,10 +164,10 @@

    Getting Help

    Example Usage

    -

    Below we provide a brief example showing how to use SSN2. For a thorough introduction to the software, see our introductory vignette linked here. For a list of all functions available in SSN2, see our function reference linked here.

    +

    Below we provide a brief example showing how to use SSN2. For a thorough introduction to the software, see our introductory vignette linked here. For a list of all functions available in SSN2, see our function reference linked here.

    We load SSN2, copy the .ssn object that comes with SSN2 to the temporary directory, and create stream distance matrices used for modeling by running

    -library(SSN2)
    +library(SSN2)
     copy_lsn_to_temp()
     path <- paste0(tempdir(), "/MiddleFork04.ssn")
     mf04p <- ssn_import(path, predpts = "pred1km")
    @@ -157,26 +183,26 @@ 

    Example Usage= "afvArea" ) summary(ssn_mod)

    -
    #>
    +
    #> 
     #> Call:
    -#> ssn_lm(formula = Summer_mn ~ ELEV_DEM + AREAWTMAP, ssn.object = mf04p,
    -#>     tailup_type = "exponential", taildown_type = "spherical",
    +#> ssn_lm(formula = Summer_mn ~ ELEV_DEM + AREAWTMAP, ssn.object = mf04p, 
    +#>     tailup_type = "exponential", taildown_type = "spherical", 
     #>     euclid_type = "gaussian", additive = "afvArea")
    -#>
    +#> 
     #> Residuals:
    -#>     Min      1Q  Median      3Q     Max
    -#> -3.6393 -2.0646 -0.5952  0.2143  0.7497
    -#>
    +#>     Min      1Q  Median      3Q     Max 
    +#> -3.6393 -2.0646 -0.5952  0.2143  0.7497 
    +#> 
     #> Coefficients (fixed):
    -#>              Estimate Std. Error z value Pr(>|z|)
    +#>              Estimate Std. Error z value Pr(>|z|)    
     #> (Intercept) 76.195041   7.871574   9.680  < 2e-16 ***
     #> ELEV_DEM    -0.026905   0.003646  -7.379  1.6e-13 ***
    -#> AREAWTMAP   -0.009099   0.004461  -2.040   0.0414 *
    +#> AREAWTMAP   -0.009099   0.004461  -2.040   0.0414 *  
     #> ---
     #> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
    -#>
    +#> 
     #> Pseudo R-squared: 0.6124
    -#>
    +#> 
     #> Coefficients (covariance):
     #>               Effect     Parameter   Estimate
     #>   tailup exponential  de (parsill)  3.800e+00
    @@ -192,7 +218,7 @@ 

    Example Usage#> # A tibble: 3 × 7 #> term estimate std.error statistic p.value conf.low conf.high #> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 (Intercept) 76.2 7.87 9.68 0 60.8 91.6 +#> 1 (Intercept) 76.2 7.87 9.68 0 60.8 91.6 #> 2 AREAWTMAP -0.00910 0.00446 -2.04 4.14e- 2 -0.0178 -0.000356 #> 3 ELEV_DEM -0.0269 0.00365 -7.38 1.60e-13 -0.0341 -0.0198

    -
    + - + diff --git a/docs/news/index.html b/docs/news/index.html index d8bca9a..47b9e5c 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -1,43 +1,72 @@ -Changelog • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    +
    -

    SSN2 0.2.0

    CRAN release: 2024-07-26

    + +
    +

    Minor Updates

    +
    • Enhanced numeric stability of deviance and pseudo R-squared for ssn_glm() models when family = "beta" (#23).
    • +
    • Updated reexport.Rd to reflect changes in spmodel v0.8.0’s handling of AIC() and AICc().
    • +
    +
    +
    +

    Major Updates

    • Significant testing, documentation, and auxiliary (e.g., README.md) updates as part of a submission to Journal of Open Source Software. Relevant issues associated with the review are available at #11, #12, #13, #14, #15, #16, #17, #20, #21. The review is linked here.
    • @@ -60,7 +89,7 @@

      Bug Fixes -

      SSN2 0.1.1

      CRAN release: 2024-01-15

      +

      Minor Updates

      • Changed network geometry name from netgeometry to netgeom to avoid exceeding the 10 character limit for column/field names while writing to shapefiles (#2).
      • @@ -81,26 +110,32 @@

        Bug Fixes -

        SSN2 0.1.0

        CRAN release: 2023-11-08

        +

        • Initial CRAN submission.
      -
    +
    + -
    - +
    +

    Site built with pkgdown 2.0.9.

    +
    +
    + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css new file mode 100644 index 0000000..80ea5b8 --- /dev/null +++ b/docs/pkgdown.css @@ -0,0 +1,384 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body { + position: relative; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +/* Ensure in-page images don't run outside their container */ +.contents img { + max-width: 100%; + height: auto; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +dd { + margin-left: 3em; +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + display: none; + margin-left: 5px; + width: 20px; + height: 20px; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +h1:hover .anchor, +h2:hover .anchor, +h3:hover .anchor, +h4:hover .anchor, +h5:hover .anchor, +h6:hover .anchor { + display: inline-block; +} + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} + +/* Sidebar --------------------------*/ + +#pkgdown-sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} + +#pkgdown-sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#pkgdown-sidebar h2:first-child { + margin-top: 0; +} + +#pkgdown-sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + +.orcid { + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top; min-width: 100px} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre, code, pre code { + background-color: #f8f8f8; + color: #333; +} +pre, pre code { + white-space: pre-wrap; + word-break: break-all; + overflow-wrap: break-word; +} + +pre { + border: 1px solid #eee; +} + +pre .img, pre .r-plt { + margin: 5px 0; +} + +pre .img img, pre .r-plt img { + background-color: #fff; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.error {font-weight: bolder;} +.warning {font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} + +/* Section anchors --------------------------------- + Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 +*/ + +div.csl-bib-body { } +div.csl-entry { + clear: both; +} +.hanging-indent div.csl-entry { + margin-left:2em; + text-indent:-2em; +} +div.csl-left-margin { + min-width:2em; + float:left; +} +div.csl-right-inline { + margin-left:2em; + padding-left:1em; +} +div.csl-indent { + margin-left: 2em; +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 9757bf9..6f0eee4 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -2,43 +2,83 @@ (function($) { $(function() { - $('nav.navbar').headroom(); + $('.navbar-fixed-top').headroom(); - Toc.init({ - $nav: $("#toc"), - $scope: $("main h2, main h3, main h4, main h5, main h6") + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); }); - if ($('#toc').length) { - $('body').scrollspy({ - target: '#toc', - offset: $("nav.navbar").outerHeight() + 1 - }); + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } } - // Activate popovers - $('[data-bs-toggle="popover"]').popover({ - container: 'body', - html: true, - trigger: 'focus', - placement: "top", - sanitize: false, - }); + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); - $('[data-bs-toggle="tooltip"]').tooltip(); + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } /* Clipboard --------------------------*/ function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-bs-original-title'); - element.setAttribute('data-bs-original-title', msg); + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); $(element).tooltip('show'); - element.setAttribute('data-bs-original-title', tooltipOriginalTitle); + element.setAttribute('data-original-title', tooltipOriginalTitle); } if(ClipboardJS.isSupported()) { $(document).ready(function() { - var copyButton = ""; + var copyButton = ""; $("div.sourceCode").addClass("hasCopyButton"); @@ -49,106 +89,20 @@ $('.btn-copy-ex').tooltip({container: 'body'}); // Initialize clipboard: - var clipboard = new ClipboardJS('[data-clipboard-copy]', { + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { text: function(trigger) { return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); } }); - clipboard.on('success', function(e) { + clipboardBtnCopies.on('success', function(e) { changeTooltipMessage(e.trigger, 'Copied!'); e.clearSelection(); }); - clipboard.on('error', function(e) { + clipboardBtnCopies.on('error', function() { changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); }); - }); } - - /* Search marking --------------------------*/ - var url = new URL(window.location.href); - var toMark = url.searchParams.get("q"); - var mark = new Mark("main#main"); - if (toMark) { - mark.mark(toMark, { - accuracy: { - value: "complementary", - limiters: [",", ".", ":", "/"], - } - }); - } - - /* Search --------------------------*/ - /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ - // Initialise search index on focus - var fuse; - $("#search-input").focus(async function(e) { - if (fuse) { - return; - } - - $(e.target).addClass("loading"); - var response = await fetch($("#search-input").data("search-index")); - var data = await response.json(); - - var options = { - keys: ["what", "text", "code"], - ignoreLocation: true, - threshold: 0.1, - includeMatches: true, - includeScore: true, - }; - fuse = new Fuse(data, options); - - $(e.target).removeClass("loading"); - }); - - // Use algolia autocomplete - var options = { - autoselect: true, - debug: true, - hint: false, - minLength: 2, - }; - var q; -async function searchFuse(query, callback) { - await fuse; - - var items; - if (!fuse) { - items = []; - } else { - q = query; - var results = fuse.search(query, { limit: 20 }); - items = results - .filter((x) => x.score <= 0.75) - .map((x) => x.item); - if (items.length === 0) { - items = [{dir:"Sorry 😿",previous_headings:"",title:"No results found.",what:"No results found.",path:window.location.href}]; - } - } - callback(items); -} - $("#search-input").autocomplete(options, [ - { - name: "content", - source: searchFuse, - templates: { - suggestion: (s) => { - if (s.title == s.what) { - return `${s.dir} >
    ${s.title}
    `; - } else if (s.previous_headings == "") { - return `${s.dir} >
    ${s.title}
    > ${s.what}`; - } else { - return `${s.dir} >
    ${s.title}
    > ${s.previous_headings} > ${s.what}`; - } - }, - }, - }, - ]).on('autocomplete:selected', function(event, s) { - window.location.href = s.path + "?q=" + q + "#" + s.id; - }); - }); })(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 9143ebf..b054806 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,6 +1,10 @@ pandoc: 3.1.11 -pkgdown: 2.1.0 +pkgdown: 2.0.9 pkgdown_sha: ~ articles: introduction: introduction.html -last_built: 2024-07-26T23:43Z +last_built: 2024-08-28T17:48Z +urls: + reference: https://usepa.github.io/SSN2/reference + article: https://usepa.github.io/SSN2/articles + diff --git a/docs/reference/AIC.SSN2.html b/docs/reference/AIC.SSN2.html index 9cb3e27..5544e5d 100644 --- a/docs/reference/AIC.SSN2.html +++ b/docs/reference/AIC.SSN2.html @@ -1,98 +1,118 @@ -Compute AIC and AICc of fitted model objects — AIC.SSN2 • SSN2Compute AIC and AICc of fitted model objects — AIC.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Compute AIC and AICc for one or several fitted model objects for which a log-likelihood value can be obtained.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     AIC(object, ..., k = 2)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     AIC(object, ..., k = 2)
     
    -# S3 method for class 'ssn_lm'
    -AICc(object, ..., k = 2)
    +# S3 method for ssn_lm
    +AICc(object, ..., k = 2)
     
    -# S3 method for class 'ssn_glm'
    -AICc(object, ..., k = 2)
    +# S3 method for ssn_glm +AICc(object, ..., k = 2)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Optionally more fitted model objects.

    -
    k
    +
    k

    The penalty parameter, taken to be 2. Currently not allowed to differ from 2 (needed for generic consistency).

    -
    -

    Value

    -

    If just one object is provided, a numeric value with the corresponding +

    +

    Value

    + + +

    If just one object is provided, a numeric value with the corresponding AIC or AICc.

    + +

    If multiple objects are provided, a data.frame with rows corresponding to the objects and columns representing the number of parameters estimated (df) and the AIC or AICc.

    -
    -

    Details

    +
    +

    Details

    When comparing models fit by maximum or restricted maximum likelihood, the smaller the AIC or AICc, the better the fit. The AICc contains a correction to AIC for small sample sizes. AIC and AICc comparisons between "ml" -and "reml" models are meaningless – comparisons should only be made +and "reml" models are meaningless -- comparisons should only be made within a set of models estimated using "ml" or a set of models estimated using "reml". AIC and AICc comparisons for "reml" must use the same fixed effects. To vary the covariance parameters and @@ -106,8 +126,8 @@

    Details

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -123,27 +143,31 @@ 

    Examples) AIC(ssn_mod) #> [1] 82.8932 -AICc(ssn_mod) +AICc(ssn_mod) #> [1] 83.47857

    -
    +
    + +
    -
    - +
    + + diff --git a/docs/reference/MiddleFork04.ssn.html b/docs/reference/MiddleFork04.ssn.html index d9d7c7d..031a0e6 100644 --- a/docs/reference/MiddleFork04.ssn.html +++ b/docs/reference/MiddleFork04.ssn.html @@ -1,62 +1,81 @@ -MiddleFork04.ssn: Middle Fork 2004 stream temperature dataset — MiddleFork04.ssn • SSN2MiddleFork04.ssn: Middle Fork 2004 stream temperature dataset — MiddleFork04.ssn • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    The MiddleFork04.ssn data folder contains the spatial, attribute, and topological information needed to construct an SSN object using the SSN2 package.

    -
    -

    Source

    +
    +

    Source

    edges are a modified version of the United States National Hydrography Dataset (http://nhd.usgs.gov/). sites, pred1km and CapeHorn are unpublished United States Forest Service data.

    -
    -

    Details

    +
    +

    Details

    The MiddleFork04.ssn folder contains five geopackages:

    -
    -

    See also

    +
    +

    See also

    mf04p for the Middle For 04 data as an SSN object.

    -
    +
    + +
    -
    - +
    + + diff --git a/docs/reference/SSN2-package.html b/docs/reference/SSN2-package.html index e7a1810..a561564 100644 --- a/docs/reference/SSN2-package.html +++ b/docs/reference/SSN2-package.html @@ -1,58 +1,78 @@ -SSN2: Spatial Modeling on Stream Networks — SSN2-package • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Spatial statistical modeling and prediction for data on stream networks, including models based on in-stream distance (Ver Hoef, J.M. and Peterson, E.E., (2010) doi:10.1198/jasa.2009.ap08248 .) Models are created using moving average constructions. Spatial linear models, including explanatory variables, can be fit with (restricted) maximum likelihood. Mapping and other graphical functions are included.

    -
    -

    See also

    -

    Useful links:

    + +
    -
    - +
    + + diff --git a/docs/reference/SSN_to_SSN2.html b/docs/reference/SSN_to_SSN2.html index 3266288..bcc0dc6 100644 --- a/docs/reference/SSN_to_SSN2.html +++ b/docs/reference/SSN_to_SSN2.html @@ -1,71 +1,89 @@ -Convert object from SpatialStreamNetwork class to SSN class — SSN_to_SSN2 • SSN2Convert object from SpatialStreamNetwork class to SSN class — SSN_to_SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Convert an S4 SpatialStreamNetwork object created in the SSN package to an S3 SSN object used in the SSN2 package.

    -
    -

    Usage

    +
    SSN_to_SSN2(object)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A SpatialStreamNetwork object

    -
    -

    Value

    -

    An S3 SSN class object.

    +
    +

    Value

    + + +

    An S3 SSN class object.

    -
    -

    Details

    +
    +

    Details

    SSN_to_SSN2() has been made available to help users migrate from the SSN package to the updated SSN2 package. It is used to convert existing S4 SpatialStreamNetwork @@ -75,23 +93,27 @@

    Details

    -
    +
    + +
    -
    + + diff --git a/docs/reference/Torgegram.html b/docs/reference/Torgegram.html index 490b9a3..0ec2a7a 100644 --- a/docs/reference/Torgegram.html +++ b/docs/reference/Torgegram.html @@ -1,51 +1,70 @@ -Compute the empirical semivariogram — Torgegram • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Compute the empirical semivariogram for varying bin sizes and cutoff values.

    -
    -

    Usage

    +
    Torgegram(
       formula,
       ssn.object,
    @@ -56,49 +75,49 @@ 

    Usage )

    -
    -

    Arguments

    - - -
    formula
    +
    +

    Arguments

    +
    formula

    A formula describing the fixed effect structure.

    -
    ssn.object
    +
    ssn.object

    A spatial stream network object with class SSN.

    -
    type
    +
    type

    The Torgegram type. A vector with possible values "flowcon" for flow-connected distances, "flowuncon" for flow-unconnected distances, and "euclid" for Euclidean distances. The default is to show both flow-connected and flow-unconnected distances.

    -
    bins
    +
    bins

    The number of equally spaced bins. The default is 15.

    -
    cutoff
    +
    cutoff

    The maximum distance considered. The default is half the diagonal of the bounding box from the coordinates.

    -
    partition_factor
    +
    partition_factor

    An optional formula specifying the partition factor. If specified, semivariances are only computed for observations sharing the same level of the partition factor.

    -
    -

    Value

    -

    A list with elements correspond to type. Each element +

    +

    Value

    + + +

    A list with elements correspond to type. Each element is data frame with distance bins (bins), the average distance (dist), the semivariance (gamma), and the number of (unique) pairs (np) for the respective type.

    -
    -

    Details

    +
    +

    Details

    The Torgegram is an empirical semivariogram is a tool used to visualize and model spatial dependence by estimating the semivariance of a process at varying distances separately for flow-connected, flow-unconnected, and Euclidean distances. @@ -119,20 +138,20 @@

    Detailscutoff).

    -
    -

    References

    +
    +

    References

    Zimmerman, D. L., & Ver Hoef, J. M. (2017). The Torgegram for fluvial variography: characterizing spatial dependence on stream networks. Journal of Computational and Graphical Statistics, -26(2), 253–264.

    +26(2), 253--264.

    -
    -

    See also

    +
    +

    See also

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -145,23 +164,27 @@ 

    Examples

    -
    +
    + +
    -
    + + diff --git a/docs/reference/anova.SSN2.html b/docs/reference/anova.SSN2.html index 19504a3..8bf8178 100644 --- a/docs/reference/anova.SSN2.html +++ b/docs/reference/anova.SSN2.html @@ -1,83 +1,100 @@ -Compute analysis of variance and likelihood ratio tests of fitted model objects — anova.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Compute analysis of variance tables for a fitted model object or a likelihood ratio test for two fitted model objects.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     anova(object, ..., test = TRUE, Terms, L)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     anova(object, ..., test = TRUE, Terms, L)
     
    -# S3 method for class 'anova.ssn_lm'
    +# S3 method for anova.ssn_lm
     tidy(x, ...)
     
    -# S3 method for class 'anova.ssn_glm'
    +# S3 method for anova.ssn_glm
     tidy(x, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    An additional fitted model object from ssn_lm() or ssn_glm() (for anova()).

    -
    test
    +
    test

    A logical value indicating whether p-values from asymptotic Chi-squared hypothesis tests should be returned. Defaults to TRUE.

    -
    Terms
    +
    Terms

    An optional character or integer vector that specifies terms in the model used to jointly compute test statistics and p-values (if test = TRUE) against a null hypothesis of zero. Terms is only used when a single fitted model @@ -89,7 +106,7 @@

    ArgumentsL +
    L

    An optional numeric matrix or list specifying linear combinations of the coefficients in the model used to compute test statistics and p-values (if test = TRUE) for coefficient constraints corresponding to a null @@ -103,27 +120,35 @@

    Argumentsx +
    x

    An object from anova(object).

    -
    -

    Value

    -

    When one fitted model object is present, anova() -returns a data frame with degrees of +

    +

    Value

    + + +

    When one fitted model object is present, anova()

    + + +

    returns a data frame with degrees of freedom (Df), test statistics (Chi2), and p-values (Pr(>Chi2) if test = TRUE) corresponding to asymptotic Chi-squared hypothesis tests for each model term.

    + +

    When two fitted model objects are present, anova() returns a data frame with the difference in degrees of freedom between the full and reduced model (Df), a test statistic (Chi2), and a p-value corresponding to the likelihood ratio test (Pr(>Chi2) if test = TRUE).

    + +

    Whether one or two fitted model objects are provided, tidy() can be used to obtain tidy tibbles of the anova(object) output.

    -
    -

    Details

    +
    +

    Details

    When one fitted model object is present, anova() performs a general linear hypothesis test corresponding to some hypothesis specified by a matrix of constraints. If Terms and L are not specified, @@ -136,8 +161,8 @@

    Detailsanova() performs a likelihood ratio test.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -168,23 +193,27 @@ 

    Examples#> 2 ELEV_DEM 1 60.8 6.32e-15

    -
    +
    + +
    -
    + + diff --git a/docs/reference/augment.SSN2.html b/docs/reference/augment.SSN2.html index 1cf31a3..b42647a 100644 --- a/docs/reference/augment.SSN2.html +++ b/docs/reference/augment.SSN2.html @@ -1,5 +1,5 @@ -Augment data with information from fitted model objects — augment.SSN2 • SSN2Augment data with information from fitted model objects — augment.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Augment accepts a fitted model object and a data set and adds information about each observation in the data set. New columns always begin with a . prefix to avoid overwriting columns in the original @@ -71,9 +82,8 @@

    Augment data with information from fitted model objects

    row in the new data set.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     augment(
       x,
       drop = TRUE,
    @@ -84,7 +94,7 @@ 

    Usage ... ) -# S3 method for class 'ssn_glm' +# S3 method for ssn_glm augment( x, drop = TRUE, @@ -99,21 +109,19 @@

    Usage )

    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    A fitted model object from ssn_lm() or ssn_glm().

    -
    drop
    +
    drop

    A logical indicating whether to drop extra variables in the fitted model object x when augmenting. The default for drop is TRUE. drop is ignored if augmenting newdata.

    -
    newdata
    +
    newdata

    A vector that contains the names of the prediction sf objects from the original ssn.object requiring prediction. All of the original explanatory variables used to create the fitted model object x @@ -124,45 +132,47 @@

    Argumentsse_fit +
    se_fit

    Logical indicating whether or not a .se.fit column should be added to augmented output. Passed to predict() and defaults to FALSE.

    -
    interval
    +
    interval

    Character indicating the type of confidence interval columns to add to the augmented newdata output. Passed to predict() and defaults to "none".

    -
    level
    +
    level

    Tolerance/confidence level. The default is 0.95.

    -
    ...
    +
    ...

    Additional arguments to predict() when augmenting newdata.

    -
    type
    +
    type

    The scale (response or link) of predictions obtained using ssn_glm objects.

    -
    newdata_size
    +
    newdata_size

    The size value for each observation in newdata used when predicting for the binomial family.

    -
    var_correct
    +
    var_correct

    A logical indicating whether to return the corrected prediction variances when predicting via models fit using ssn_glm. The default is TRUE.

    -
    -

    Value

    -

    When augmenting the original data set, a tibble with additional columns

    + + diff --git a/docs/reference/coef.SSN2.html b/docs/reference/coef.SSN2.html index d731f45..03bc561 100644 --- a/docs/reference/coef.SSN2.html +++ b/docs/reference/coef.SSN2.html @@ -1,73 +1,90 @@ -Extract fitted model coefficients — coef.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    coef extracts fitted model coefficients from fitted model objects. coefficients is an alias for it.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     coef(object, type = "fixed", ...)
     
    -# S3 method for class 'ssn_lm'
    +# S3 method for ssn_lm
     coefficients(object, type = "fixed", ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     coef(object, type = "fixed", ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     coefficients(object, type = "fixed", ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    type
    +
    type

    "fixed" for fixed effect coefficients, "tailup" for tailup covariance parameter coefficients, "taildown" for taildown covariance parameter coefficients, "euclid" for @@ -79,17 +96,19 @@

    Arguments.

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A named vector of coefficients.

    +
    +

    Value

    + + +

    A named vector of coefficients.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -116,23 +135,27 @@ 

    Examples#> 80.8578372 -0.0341245

    -
    +
    + +
    -
    + + diff --git a/docs/reference/confint.SSN2.html b/docs/reference/confint.SSN2.html index f4c262b..9dfae09 100644 --- a/docs/reference/confint.SSN2.html +++ b/docs/reference/confint.SSN2.html @@ -1,88 +1,107 @@ -Confidence intervals for fitted model parameters — confint.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Computes confidence intervals for one or more parameters in a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     confint(object, parm, level = 0.95, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     confint(object, parm, level = 0.95, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    parm
    +
    parm

    A specification of which parameters are to be given confidence intervals (a character vector of names). If missing, all parameters are considered.

    -
    level
    +
    level

    The confidence level required. The default is 0.95.

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    Gaussian-based confidence intervals (two-sided and equal-tailed) for the +

    +

    Value

    + + +

    Gaussian-based confidence intervals (two-sided and equal-tailed) for the fixed effect coefficients based on the confidence level specified by level. For ssn_glm() objects, confidence intervals are on the link scale.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -106,23 +125,27 @@ 

    Examples#> ELEV_DEM -0.04132307 -0.02692593

    -
    +
    + +
    -
    + + diff --git a/docs/reference/cooks.distance.SSN2.html b/docs/reference/cooks.distance.SSN2.html index b149ec1..a8d9b49 100644 --- a/docs/reference/cooks.distance.SSN2.html +++ b/docs/reference/cooks.distance.SSN2.html @@ -1,89 +1,108 @@ -Compute Cook's distance — cooks.distance.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Compute the Cook's distance for each observation from a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     cooks.distance(model, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     cooks.distance(model, ...)
    -
    -

    Arguments

    - - -
    model
    +
    +

    Arguments

    +
    model

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A vector of Cook's distance values for each observation from the +

    +

    Value

    + + +

    A vector of Cook's distance values for each observation from the fitted model object.

    -
    -

    Details

    +
    +

    Details

    Cook's distance measures the influence of an observation on a fitted model object. If an observation is influential, its omission from the data noticeably impacts parameter estimates. The larger the Cook's distance, the larger the influence.

    -
    -

    See also

    + -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -116,23 +135,27 @@ 

    Examples#> 1.208746e-02 4.362963e-02 5.795615e-01

    -
    +
    + +
    -
    + + diff --git a/docs/reference/copy_lsn_to_temp.html b/docs/reference/copy_lsn_to_temp.html index a905072..e00afbe 100644 --- a/docs/reference/copy_lsn_to_temp.html +++ b/docs/reference/copy_lsn_to_temp.html @@ -1,68 +1,88 @@ -Copy LSN to temporary directory — copy_lsn_to_temp • SSN2Copy LSN to temporary directory — copy_lsn_to_temp • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Copies the LSN directory MiddleFork04.ssn to R's temporary directory so the examples in SSN2 do not write to the local library or any other places.

    -
    -

    Usage

    +
    copy_lsn_to_temp()
    -
    -

    Value

    -

    A copy of MiddleFork04.ssn residing in R's temporary directory

    +
    +

    Value

    + + +

    A copy of MiddleFork04.ssn residing in R's temporary directory

    -
    -

    Details

    +
    +

    Details

    Copies the LSN directory MiddleFork04.ssn to R's temporary directory

    -
    -

    Examples

    +
    +

    Examples

    copy_lsn_to_temp()
     # getwd()
     # setwd(tempdir())
    @@ -71,23 +91,27 @@ 

    Examples# if windows, list temporary directory contents using: shell('dir')

    -
    +
    + +
    -
    + + diff --git a/docs/reference/covmatrix.SSN2.html b/docs/reference/covmatrix.SSN2.html index 34fe3a2..4eb55bd 100644 --- a/docs/reference/covmatrix.SSN2.html +++ b/docs/reference/covmatrix.SSN2.html @@ -1,64 +1,82 @@ -Create a covariance matrix — covmatrix.SSN2 • SSN2 - Skip to contents +Create a covariance matrix — covmatrix.SSN2 • SSN2 + +
    +
    -
    -
    -
    +
    + -
    +

    Create a covariance matrix from a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     covmatrix(object, newdata, cov_type, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     covmatrix(object, newdata, cov_type, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object (e.g., ssn_lm() or ssn_glm()).

    -
    newdata
    +
    newdata

    If omitted, the covariance matrix of the observed data is returned. If provided, newdata is a data frame or sf object that contains coordinate information @@ -69,7 +87,7 @@

    Argumentscov_type +
    cov_type

    The type of covariance matrix returned. If newdata is omitted, the \(n \times n\) covariance matrix of the observed data is returned, where \(n\) is the sample size used to fit object. @@ -82,17 +100,19 @@

    Arguments... +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A covariance matrix (see cov_type).

    +
    +

    Value

    + + +

    A covariance matrix (see cov_type).

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -3707,23 +3727,27 @@ 

    Examples#> [654,] 1.0542293 0

    -
    +
    + +
    -
    + + diff --git a/docs/reference/create_netgeom.html b/docs/reference/create_netgeom.html index 8daf6ca..a310ac1 100644 --- a/docs/reference/create_netgeom.html +++ b/docs/reference/create_netgeom.html @@ -1,80 +1,99 @@ -Create netgeom column in SSN object — create_netgeom • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Create netgeom column for edges, observed sites, and/or prediction sites in a Landscape Network (LSN).

    -
    -

    Usage

    +
    create_netgeom(sf_data, type = NULL, overwrite = FALSE)
    -
    -

    Arguments

    - - -
    sf_data
    +
    +

    Arguments

    +
    sf_data

    An sf object with LINESTING or POINT geometry created using link{lsn_to_ssn} (see Details).

    -
    type
    +
    type

    Character string defining geometry type of sf_data. Default = NULL.

    -
    overwrite
    +
    overwrite

    Logical indicating whether existing data should be overwritten if present. Default = FALSE.

    -
    -

    Value

    -

    An sf object containing the original data from +

    +

    Value

    + + +

    An sf object containing the original data from sf_data and an additional column named netgeom.

    -
    -

    Details

    +
    +

    Details

    Most users will not need to run create_netgeom themselves because it is called internally when lsn_to_ssn is run or an SSN is imported using @@ -95,8 +114,8 @@

    Detailssf_data, the data will be overwritten. Default = FALSE.

    -
    -

    Examples

    +
    +

    Examples

    ## Create local temporary copy of MiddleFork04.ssn found in
     ## the SSN2 package. Only necessary for this example.
     copy_lsn_to_temp()
    @@ -123,23 +142,27 @@ 

    Examples)

    -
    +
    + +
    -
    + + diff --git a/docs/reference/deviance.SSN2.html b/docs/reference/deviance.SSN2.html index 18fea64..f1516b1 100644 --- a/docs/reference/deviance.SSN2.html +++ b/docs/reference/deviance.SSN2.html @@ -1,79 +1,99 @@ -Fitted model deviance — deviance.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Returns the deviance of a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     deviance(object, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     deviance(object, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    The deviance.

    +
    +

    Value

    + + +

    The deviance.

    -
    -

    Details

    +
    +

    Details

    The deviance is twice the difference in log-likelihoods between the saturated (perfect-fit) model and the fitted model.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -92,23 +112,27 @@ 

    Examples#> [1] 9.832514e-05

    -
    +
    + +
    -
    + + diff --git a/docs/reference/fitted.SSN2.html b/docs/reference/fitted.SSN2.html index 954a5c9..18fe26e 100644 --- a/docs/reference/fitted.SSN2.html +++ b/docs/reference/fitted.SSN2.html @@ -1,73 +1,90 @@ -Extract model fitted values — fitted.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Extract fitted values from fitted model objects. fitted.values is an alias.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     fitted(object, type = "response", ...)
     
    -# S3 method for class 'ssn_lm'
    +# S3 method for ssn_lm
     fitted.values(object, type = "response", ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     fitted(object, type = "response", ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     fitted.values(object, type = "response", ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    type
    +
    type

    "response" for fitted values of the response, "tailup" for fitted values of the tailup random errors, "taildown" for fitted values of the taildown random errors, @@ -78,16 +95,18 @@

    Arguments.

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    The fitted values according to type.

    +
    +

    Value

    + + +

    The fitted values according to type.

    -
    -

    Details

    +
    +

    Details

    When type is "response", the fitted values for each observation are the standard fitted values \(X \hat{\beta}\). When type is "tailup", "taildown", "euclid", @@ -105,8 +124,8 @@

    Details

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -148,23 +167,27 @@ 

    Examples#> 10.186001 9.981254 12.062849 11.448608 11.175612

    -
    +
    + +
    -
    + + diff --git a/docs/reference/formula.SSN2.html b/docs/reference/formula.SSN2.html index 7514adb..a13b71b 100644 --- a/docs/reference/formula.SSN2.html +++ b/docs/reference/formula.SSN2.html @@ -1,74 +1,94 @@ -Model formulae — formula.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Return formula used by a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     formula(x, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     formula(x, ...)
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    The formula used by a fitted model object.

    +
    +

    Value

    + + +

    The formula used by a fitted model object.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -84,26 +104,30 @@ 

    Examples) formula(ssn_mod) #> Summer_mn ~ ELEV_DEM -#> <environment: 0x0000024c3c78fe60> +#> <environment: 0x0000028e1c9bdc80>

    -
    +
    + +
    -
    - +
    + + diff --git a/docs/reference/glance.SSN2.html b/docs/reference/glance.SSN2.html index e226027..3717f9e 100644 --- a/docs/reference/glance.SSN2.html +++ b/docs/reference/glance.SSN2.html @@ -1,76 +1,94 @@ -Glance at a fitted model object — glance.SSN2 • SSN2Glance at a fitted model object — glance.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Returns a row of model summaries from a fitted model object. Glance returns the same number of columns for all models and estimation methods.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     glance(x, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     glance(x, ...)
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A single-row tibble with columns

    • n The sample size.

    • +
      +

      Value

      + + +

      A single-row tibble with columns

      • n The sample size.

      • p The number of fixed effects.

      • npar The number of estimated covariance parameters.

      • value The optimized value of the fitting function

      • @@ -81,8 +99,8 @@

        Value

        pseudo.r.squared The pseudo r-squared

      -
      -

      Examples

      +
      +

      Examples

      # Copy the mf04p .ssn data to a local directory and read it into R
       # When modeling with your .ssn object, you will load it using the relevant
       # path to the .ssn data on your machine
      @@ -103,23 +121,27 @@ 

      Examples#> 1 45 2 3 76.9 82.9 83.5 -38.4 43.0 0.585

      -
      +
    + +
    -
    + + diff --git a/docs/reference/glances.SSN2.html b/docs/reference/glances.SSN2.html index 435a7f7..0e0a78b 100644 --- a/docs/reference/glances.SSN2.html +++ b/docs/reference/glances.SSN2.html @@ -1,88 +1,107 @@ -Glance at many fitted model objects — glances.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    glances() repeatedly calls glance() on several fitted model objects and binds the output together, sorted by a column of interest.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     glances(object, ..., sort_by = "AICc", decreasing = FALSE)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     glances(object, ..., sort_by = "AICc", decreasing = FALSE)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    Fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Additional fitted model objects from ssn_lm() or ssn_glm().

    -
    sort_by
    +
    sort_by

    Sort by a glance statistic (i.e., the name of a column output from glance() or the order of model input (sort_by = "order"). The default is "AICc".

    -
    decreasing
    +
    decreasing

    Should sort_by be decreasing or not? The default is FALSE.

    -
    -

    Value

    -

    A tibble where each row represents the output of glance() for +

    +

    Value

    + + +

    A tibble where each row represents the output of glance() for each fitted model object.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -111,23 +130,27 @@ 

    Examples#> 2 ssn_mod2 45 2 3 123. 129. 129. -61.4 43.4 0.0917

    -
    +
    + +
    -
    + + diff --git a/docs/reference/hatvalues.SSN2.html b/docs/reference/hatvalues.SSN2.html index 6d6b72b..07c7e6c 100644 --- a/docs/reference/hatvalues.SSN2.html +++ b/docs/reference/hatvalues.SSN2.html @@ -1,90 +1,109 @@ -Compute leverage (hat) values — hatvalues.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Compute the leverage (hat) value for each observation from a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     hatvalues(model, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     hatvalues(model, ...)
    -
    -

    Arguments

    - - -
    model
    +
    +

    Arguments

    +
    model

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A vector of leverage (hat) values for each observation from the +

    +

    Value

    + + +

    A vector of leverage (hat) values for each observation from the fitted model object.

    -
    -

    Details

    +
    +

    Details

    Leverage values measure how far an observation's explanatory variables are relative to the average of the explanatory variables. In other words, observations with high leverage are typically considered to have an extreme or unusual combination of explanatory variables. Leverage values are the diagonal of the hat (projection) matrix. The larger the hat value, the larger the leverage.

    -
    -

    See also

    + -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -117,23 +136,27 @@ 

    Examples#> 0.138148339 0.030372326 0.159209917

    -
    +
    + +
    -
    + + diff --git a/docs/reference/index.html b/docs/reference/index.html index c4c0eb8..59b59a0 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -1,392 +1,303 @@ -Package index • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    -

    All functions

    - - - - -
    - - - - -
    - - AIC(<ssn_lm>) AIC(<ssn_glm>) AICc(<ssn_lm>) AICc(<ssn_glm>) - -
    -
    Compute AIC and AICc of fitted model objects
    -
    - - anova(<ssn_lm>) anova(<ssn_glm>) tidy(<anova.ssn_lm>) tidy(<anova.ssn_glm>) - -
    -
    Compute analysis of variance and likelihood ratio tests of fitted model objects
    -
    - - augment(<ssn_lm>) augment(<ssn_glm>) - -
    -
    Augment data with information from fitted model objects
    -
    - - coef(<ssn_lm>) coefficients(<ssn_lm>) coef(<ssn_glm>) coefficients(<ssn_glm>) - -
    -
    Extract fitted model coefficients
    -
    - - confint(<ssn_lm>) confint(<ssn_glm>) - -
    -
    Confidence intervals for fitted model parameters
    -
    - - cooks.distance(<ssn_lm>) cooks.distance(<ssn_glm>) - -
    -
    Compute Cook's distance
    -
    - - copy_lsn_to_temp() - -
    -
    Copy LSN to temporary directory
    -
    - - covmatrix(<ssn_lm>) covmatrix(<ssn_glm>) - -
    -
    Create a covariance matrix
    -
    - - create_netgeom() - -
    -
    Create netgeom column in SSN object
    -
    - - deviance(<ssn_lm>) deviance(<ssn_glm>) - -
    -
    Fitted model deviance
    -
    - - fitted(<ssn_lm>) fitted.values(<ssn_lm>) fitted(<ssn_glm>) fitted.values(<ssn_glm>) - -
    -
    Extract model fitted values
    -
    - - formula(<ssn_lm>) formula(<ssn_glm>) - -
    -
    Model formulae
    -
    - - glance(<ssn_lm>) glance(<ssn_glm>) - -
    -
    Glance at a fitted model object
    -
    - - glances(<ssn_lm>) glances(<ssn_glm>) - -
    -
    Glance at many fitted model objects
    -
    - - hatvalues(<ssn_lm>) hatvalues(<ssn_glm>) - -
    -
    Compute leverage (hat) values
    -
    - - influence(<ssn_lm>) influence(<ssn_glm>) - -
    -
    Regression diagnostics
    -
    - - labels(<ssn_lm>) labels(<ssn_glm>) - -
    -
    Find labels from object
    -
    - - logLik(<ssn_lm>) logLik(<ssn_glm>) - -
    -
    Extract log-likelihood
    -
    - - loocv(<ssn_lm>) loocv(<ssn_glm>) - -
    -
    Perform leave-one-out cross validation
    -
    - - mf04p - -
    -
    Imported SSN object from the MiddleFork04.ssn data folder
    -
    - - MiddleFork04.ssn - -
    -
    MiddleFork04.ssn: Middle Fork 2004 stream temperature dataset
    -
    - - model.frame(<ssn_lm>) model.frame(<ssn_glm>) - -
    -
    Extract the model frame from a fitted model object
    -
    - - model.matrix(<ssn_lm>) model.matrix(<ssn_glm>) - -
    -
    Extract the model matrix from a fitted model object
    -
    - - plot(<ssn_lm>) plot(<ssn_glm>) - -
    -
    Plot fitted model diagnostics
    -
    - - plot(<Torgegram>) - -
    -
    Plot Torgegram
    -
    - - predict(<ssn_lm>) predict(<ssn_glm>) - -
    -
    Model predictions (Kriging)
    -
    - - print(<SSN>) - -
    -
    Print SSN object
    -
    - - print(<ssn_lm>) print(<ssn_glm>) print(<summary.ssn_lm>) print(<summary.ssn_glm>) print(<anova.ssn_lm>) print(<anova.ssn_glm>) - -
    -
    Print values
    -
    - - pseudoR2(<ssn_lm>) pseudoR2(<ssn_glm>) - -
    -
    Compute a pseudo r-squared
    -
    - - residuals(<ssn_lm>) resid(<ssn_lm>) rstandard(<ssn_lm>) residuals(<ssn_glm>) resid(<ssn_glm>) rstandard(<ssn_glm>) - -
    -
    Extract fitted model residuals
    -
    - - ssn_create_distmat() - -
    -
    Calculate Hydrologic Distances for an SSN object
    -
    - - ssn_get_data() - -
    -
    Get a data.frame from an SSN, ssn_lm, or ssn_glm object
    -
    - - ssn_get_netgeom() - -
    -
    Extract netgeom column
    -
    - - ssn_get_stream_distmat() - -
    -
    Get stream distance matrices from an SSN object
    -
    - - ssn_glm() - -
    -
    Fitting Generalized Linear Models for Spatial Stream Networks
    -
    - - ssn_import() - -
    -
    Import SSN object
    -
    - - ssn_import_predpts() - -
    -
    Import prediction points into an SSN, ssn_lm, or ssn_glm object
    -
    - - tailup_initial() taildown_initial() euclid_initial() nugget_initial() - -
    -
    Create a covariance parameter initial object
    -
    - - ssn_lm() - -
    -
    Fitting Linear Models for Spatial Stream Networks
    -
    - - ssn_names() - -
    -
    Return names of data in an SSN object
    -
    - - tailup_params() taildown_params() euclid_params() nugget_params() - -
    -
    Create covariance parameter objects.
    -
    - - ssn_put_data() - -
    -
    Put an sf data.frame in an SSN object
    -
    - - ssn_simulate() ssn_rbeta() ssn_rbinom() ssn_rgamma() ssn_rinvgauss() ssn_rnbinom() ssn_rnorm() ssn_rpois() - -
    -
    Simulate random variables on a stream network
    -
    - - ssn_split_predpts() - -
    -
    Split a prediction dataset in an SSN object
    -
    - - ssn_subset() - -
    -
    Subset an SSN object
    -
    - - SSN_to_SSN2() - -
    -
    Convert object from SpatialStreamNetwork class to SSN class
    -
    - - ssn_update_path() - -
    -
    Update path in an SSN object
    -
    - - ssn_write() - -
    -
    write an SSN object
    -
    - - summary(<SSN>) - -
    -
    Summarize an SSN object
    -
    - - summary(<ssn_lm>) summary(<ssn_glm>) - -
    -
    Summarize a fitted model object
    -
    - - tidy(<ssn_lm>) tidy(<ssn_glm>) - -
    -
    Tidy a fitted model object
    -
    - - Torgegram() - -
    -
    Compute the empirical semivariogram
    -
    - - varcomp(<ssn_lm>) varcomp(<ssn_glm>) - -
    -
    Variability component comparison
    -
    - - vcov(<ssn_lm>) vcov(<ssn_glm>) - -
    -
    Calculate variance-covariance matrix for a fitted model object
    -
    -
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    All functions

    +

    +
    +

    AIC(<ssn_lm>) AIC(<ssn_glm>) AICc(<ssn_lm>) AICc(<ssn_glm>)

    +

    Compute AIC and AICc of fitted model objects

    +

    anova(<ssn_lm>) anova(<ssn_glm>) tidy(<anova.ssn_lm>) tidy(<anova.ssn_glm>)

    +

    Compute analysis of variance and likelihood ratio tests of fitted model objects

    +

    augment(<ssn_lm>) augment(<ssn_glm>)

    +

    Augment data with information from fitted model objects

    +

    coef(<ssn_lm>) coefficients(<ssn_lm>) coef(<ssn_glm>) coefficients(<ssn_glm>)

    +

    Extract fitted model coefficients

    +

    confint(<ssn_lm>) confint(<ssn_glm>)

    +

    Confidence intervals for fitted model parameters

    +

    cooks.distance(<ssn_lm>) cooks.distance(<ssn_glm>)

    +

    Compute Cook's distance

    +

    copy_lsn_to_temp()

    +

    Copy LSN to temporary directory

    +

    covmatrix(<ssn_lm>) covmatrix(<ssn_glm>)

    +

    Create a covariance matrix

    +

    create_netgeom()

    +

    Create netgeom column in SSN object

    +

    deviance(<ssn_lm>) deviance(<ssn_glm>)

    +

    Fitted model deviance

    +

    fitted(<ssn_lm>) fitted.values(<ssn_lm>) fitted(<ssn_glm>) fitted.values(<ssn_glm>)

    +

    Extract model fitted values

    +

    formula(<ssn_lm>) formula(<ssn_glm>)

    +

    Model formulae

    +

    glance(<ssn_lm>) glance(<ssn_glm>)

    +

    Glance at a fitted model object

    +

    glances(<ssn_lm>) glances(<ssn_glm>)

    +

    Glance at many fitted model objects

    +

    hatvalues(<ssn_lm>) hatvalues(<ssn_glm>)

    +

    Compute leverage (hat) values

    +

    influence(<ssn_lm>) influence(<ssn_glm>)

    +

    Regression diagnostics

    +

    labels(<ssn_lm>) labels(<ssn_glm>)

    +

    Find labels from object

    +

    logLik(<ssn_lm>) logLik(<ssn_glm>)

    +

    Extract log-likelihood

    +

    loocv(<ssn_lm>) loocv(<ssn_glm>)

    +

    Perform leave-one-out cross validation

    +

    mf04p

    +

    Imported SSN object from the MiddleFork04.ssn data folder

    +

    MiddleFork04.ssn

    +

    MiddleFork04.ssn: Middle Fork 2004 stream temperature dataset

    +

    model.frame(<ssn_lm>) model.frame(<ssn_glm>)

    +

    Extract the model frame from a fitted model object

    +

    model.matrix(<ssn_lm>) model.matrix(<ssn_glm>)

    +

    Extract the model matrix from a fitted model object

    +

    plot(<ssn_lm>) plot(<ssn_glm>)

    +

    Plot fitted model diagnostics

    +

    plot(<Torgegram>)

    +

    Plot Torgegram

    +

    predict(<ssn_lm>) predict(<ssn_glm>)

    +

    Model predictions (Kriging)

    +

    print(<SSN>)

    +

    Print SSN object

    +

    print(<ssn_lm>) print(<ssn_glm>) print(<summary.ssn_lm>) print(<summary.ssn_glm>) print(<anova.ssn_lm>) print(<anova.ssn_glm>)

    +

    Print values

    +

    pseudoR2(<ssn_lm>) pseudoR2(<ssn_glm>)

    +

    Compute a pseudo r-squared

    +

    residuals(<ssn_lm>) resid(<ssn_lm>) rstandard(<ssn_lm>) residuals(<ssn_glm>) resid(<ssn_glm>) rstandard(<ssn_glm>)

    +

    Extract fitted model residuals

    +

    ssn_create_distmat()

    +

    Calculate Hydrologic Distances for an SSN object

    +

    ssn_get_data()

    +

    Get a data.frame from an SSN, ssn_lm, or ssn_glm object

    +

    ssn_get_netgeom()

    +

    Extract netgeom column

    +

    ssn_get_stream_distmat()

    +

    Get stream distance matrices from an SSN object

    +

    ssn_glm()

    +

    Fitting Generalized Linear Models for Spatial Stream Networks

    +

    ssn_import()

    +

    Import SSN object

    +

    ssn_import_predpts()

    +

    Import prediction points into an SSN, ssn_lm, or ssn_glm object

    +

    tailup_initial() taildown_initial() euclid_initial() nugget_initial()

    +

    Create a covariance parameter initial object

    +

    ssn_lm()

    +

    Fitting Linear Models for Spatial Stream Networks

    +

    ssn_names()

    +

    Return names of data in an SSN object

    +

    tailup_params() taildown_params() euclid_params() nugget_params()

    +

    Create covariance parameter objects.

    +

    ssn_put_data()

    +

    Put an sf data.frame in an SSN object

    +

    ssn_simulate() ssn_rbeta() ssn_rbinom() ssn_rgamma() ssn_rinvgauss() ssn_rnbinom() ssn_rnorm() ssn_rpois()

    +

    Simulate random variables on a stream network

    +

    ssn_split_predpts()

    +

    Split a prediction dataset in an SSN object

    +

    ssn_subset()

    +

    Subset an SSN object

    +

    SSN_to_SSN2()

    +

    Convert object from SpatialStreamNetwork class to SSN class

    +

    ssn_update_path()

    +

    Update path in an SSN object

    +

    ssn_write()

    +

    write an SSN object

    +

    summary(<SSN>)

    +

    Summarize an SSN object

    +

    summary(<ssn_lm>) summary(<ssn_glm>)

    +

    Summarize a fitted model object

    +

    tidy(<ssn_lm>) tidy(<ssn_glm>)

    +

    Tidy a fitted model object

    +

    Torgegram()

    +

    Compute the empirical semivariogram

    +

    varcomp(<ssn_lm>) varcomp(<ssn_glm>)

    +

    Variability component comparison

    +

    vcov(<ssn_lm>) vcov(<ssn_glm>)

    +

    Calculate variance-covariance matrix for a fitted model object

    + + +
    -
    - +
    + + diff --git a/docs/reference/influence.SSN2.html b/docs/reference/influence.SSN2.html index b30b17c..93e0ae4 100644 --- a/docs/reference/influence.SSN2.html +++ b/docs/reference/influence.SSN2.html @@ -1,88 +1,107 @@ -Regression diagnostics — influence.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Provides basic quantities which are used in forming a wide variety of diagnostics for checking the quality of fitted model objects.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     influence(model, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     influence(model, ...)
    -
    -

    Arguments

    - - -
    model
    +
    +

    Arguments

    +
    model

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A tibble with residuals (.resid), leverage values (.hat), +

    +

    Value

    + + +

    A tibble with residuals (.resid), leverage values (.hat), cook's distance (.cooksd), and standardized residuals (.std.resid).

    -
    -

    Details

    +
    +

    Details

    This function calls residuals.SSN2(), hatvalues.SSN2(), and cooks.distance.SSN2() and puts the results into a tibble. It is primarily used when calling augment.SSN2().

    -
    -

    See also

    + -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -113,23 +132,27 @@ 

    Examples#> # ℹ 35 more rows

    -
    +
    + +
    -
    + + diff --git a/docs/reference/labels.SSN2.html b/docs/reference/labels.SSN2.html index 46fcd1d..eb40267 100644 --- a/docs/reference/labels.SSN2.html +++ b/docs/reference/labels.SSN2.html @@ -1,75 +1,95 @@ -Find labels from object — labels.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Find a suitable set of labels from a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     labels(object, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     labels(object, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A character vector containing the terms used for the fixed effects +

    +

    Value

    + + +

    A character vector containing the terms used for the fixed effects from a fitted model object.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -87,23 +107,27 @@ 

    Examples#> [1] "ELEV_DEM"

    -
    +
    + +
    -
    + + diff --git a/docs/reference/logLik.SSN2.html b/docs/reference/logLik.SSN2.html index 3636639..5cf247e 100644 --- a/docs/reference/logLik.SSN2.html +++ b/docs/reference/logLik.SSN2.html @@ -1,74 +1,94 @@ -Extract log-likelihood — logLik.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Find the log-likelihood of a fitted model.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     logLik(object, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     logLik(object, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    The log-likelihood.

    +
    +

    Value

    + + +

    The log-likelihood.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -86,23 +106,27 @@ 

    Examples#> [1] -38.4466

    -
    +
    + +
    -
    + + diff --git a/docs/reference/loocv.SSN2.html b/docs/reference/loocv.SSN2.html index 23dccff..729816f 100644 --- a/docs/reference/loocv.SSN2.html +++ b/docs/reference/loocv.SSN2.html @@ -1,83 +1,102 @@ -Perform leave-one-out cross validation — loocv.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Perform leave-one-out cross validation with options for computationally efficient approximations for big data.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     loocv(object, cv_predict = FALSE, se.fit = FALSE, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     loocv(object, cv_predict = FALSE, se.fit = FALSE, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    cv_predict
    +
    cv_predict

    A logical indicating whether the leave-one-out fitted values should be returned. Defaults to FALSE.

    -
    se.fit
    +
    se.fit

    A logical indicating whether the leave-one-out prediction standard errors should be returned. Defaults to FALSE.

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    If cv_predict = FALSE and se.fit = FALSE, +

    +

    Value

    + + +

    If cv_predict = FALSE and se.fit = FALSE, a tibble indicating several leave-one-out cross validation error metrics. If cv_predict = TRUE or se.fit = TRUE, a list with elements: stats, a tibble indicating several @@ -85,6 +104,8 @@

    Value

    cv_predict = TRUE
    ); and se.fit, a numeric vector with leave-one-out prediction standard errors for each observation (if se.fit = TRUE).

    + +

    If an ssn_lm object, the cross validation error metrics are:

    • bias: The average difference between the predicted value and true value

    • std.bias: The average standardized difference between the predicted value and true value

    • MSPE: The average squared difference between the predicted value and true value

    • @@ -100,16 +121,16 @@

      Value

      RMSPE: The root average squared difference between the predicted value and true value

    • RAV: The root of the average estimated variance of the predicted value (on the link scale)

    -
    -

    Details

    +
    +

    Details

    Each observation is held-out from the data set and the remaining data are used to make a prediction for the held-out observation. This is compared to the true value of the observation and several model-fit statistics are computed across all observations.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -130,23 +151,27 @@ 

    Examples#> 1 0.0449 0.0456 0.273 0.522 1.23 0.418 0.930 0.8 0.889 0.911

    -
    +
    + +
    -
    + + diff --git a/docs/reference/mf04p.html b/docs/reference/mf04p.html index 48b2d67..e6690fe 100644 --- a/docs/reference/mf04p.html +++ b/docs/reference/mf04p.html @@ -1,88 +1,109 @@ -Imported SSN object from the MiddleFork04.ssn data folder — mf04p • SSN2Imported SSN object from the MiddleFork04.ssn data folder — mf04p • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    The MiddleFork04.ssn data folder contains the spatial, attribute, and topological information needed to construct a spatial stream network object using the SSN2 package. mf04p was created using ssn_import().

    -
    -

    Usage

    +
    mf04p
    -
    -

    Format

    +
    +

    Format

    An object of class SSN of length 4.

    -
    -

    See also

    +
    +

    See also

    MiddleFork04.ssn for details about the contents of mf04p. ssn_import() to convert a .ssn object to an SSN object in R. ssn_create_distmat for details about the distance matrix file structure.

    -
    +
    + +
    -
    - +
    + + diff --git a/docs/reference/model.frame.SSN2.html b/docs/reference/model.frame.SSN2.html index cf1cd63..bc38a1c 100644 --- a/docs/reference/model.frame.SSN2.html +++ b/docs/reference/model.frame.SSN2.html @@ -1,79 +1,99 @@ -Extract the model frame from a fitted model object — model.frame.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Extract the model frame from a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     model.frame(formula, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     model.frame(formula, ...)
    -
    -

    Arguments

    - - -
    formula
    +
    +

    Arguments

    +
    formula

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A model frame that contains the variables used by the formula +

    +

    Value

    + + +

    A model frame that contains the variables used by the formula for the fitted model object.

    -
    -

    See also

    + -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -136,23 +156,27 @@ 

    Examples#> 45 9.02 2042

    -
    +
    + +
    -
    + + diff --git a/docs/reference/model.matrix.SSN2.html b/docs/reference/model.matrix.SSN2.html index a88dcd1..66d58d4 100644 --- a/docs/reference/model.matrix.SSN2.html +++ b/docs/reference/model.matrix.SSN2.html @@ -1,80 +1,100 @@ -Extract the model matrix from a fitted model object — model.matrix.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Extract the model matrix (X) from a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     model.matrix(object, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     model.matrix(object, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    The model matrix (of the fixed effects), whose rows represent +

    +

    Value

    + + +

    The model matrix (of the fixed effects), whose rows represent observations and whose columns represent explanatory variables corresponding to each fixed effect.

    -
    -

    See also

    + -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -139,23 +159,27 @@ 

    Examples#> [1] 0 1

    -
    +
    + +
    -
    + + diff --git a/docs/reference/plot.SSN2.html b/docs/reference/plot.SSN2.html index e6730b8..8a79bb5 100644 --- a/docs/reference/plot.SSN2.html +++ b/docs/reference/plot.SSN2.html @@ -1,86 +1,104 @@ -Plot fitted model diagnostics — plot.SSN2 • SSN2Plot fitted model diagnostics — plot.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Plot fitted model diagnostics such as residuals vs fitted values, quantile-quantile, scale-location, Cook's distance, residuals vs leverage, and Cook's distance vs leverage.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     plot(x, which, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     plot(x, which, ...)
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    A fitted model object from ssn_lm() or ssn_glm().

    -
    which
    +
    which

    An integer vector taking on values between 1 and 6, which indicates the plots to return. Available plots are described in Details. If which has length greater than one, additional plots are stepped through in order using <Return>. The default is which = c(1, 2)

    -
    ...
    +
    ...

    Other arguments passed to other methods.

    -
    -

    Value

    -

    No return value. Function called for plotting side effects.

    +
    +

    Value

    + + +

    No return value. Function called for plotting side effects.

    -
    -

    Details

    +
    +

    Details

    For all fitted model objects,, the values of which make the corresponding plot:

    -
    -

    See also

    +
    +

    See also

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -113,23 +131,27 @@ 

    Examples

    -
    +
    + +
    -
    + + diff --git a/docs/reference/plot.Torgegram.html b/docs/reference/plot.Torgegram.html index 5fb227e..5a211a8 100644 --- a/docs/reference/plot.Torgegram.html +++ b/docs/reference/plot.Torgegram.html @@ -1,85 +1,105 @@ -Plot Torgegram — plot.Torgegram • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Plot Torgegram

    -
    -

    Usage

    -
    # S3 method for class 'Torgegram'
    +    
    +
    # S3 method for Torgegram
     plot(x, type, separate = FALSE, ...)
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    A Torgegram object from Torgegram().

    -
    type
    +
    type

    The type of semivariogram. Can take character values that are a subset of objects in x. The default is names(x).

    -
    separate
    +
    separate

    When type is length greater than one, whether each type be placed in a separate plot. The default is FALSE.

    -
    ...
    +
    ...

    Other arguments passed to other methods.

    -
    -

    Value

    -

    No return value. Function called for plotting side effects.

    +
    +

    Value

    + + +

    No return value. Function called for plotting side effects.

    -
    -

    See also

    +
    +

    See also

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -92,23 +112,27 @@ 

    Examples

    -
    +
    + +
    -
    + + diff --git a/docs/reference/predict.SSN2.html b/docs/reference/predict.SSN2.html index 7d49959..59bf7a2 100644 --- a/docs/reference/predict.SSN2.html +++ b/docs/reference/predict.SSN2.html @@ -1,49 +1,69 @@ -Model predictions (Kriging) — predict.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Predicted values and intervals based on a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     predict(
       object,
       newdata,
    @@ -54,7 +74,7 @@ 

    Usage ... ) -# S3 method for class 'ssn_glm' +# S3 method for ssn_glm predict( object, newdata, @@ -68,15 +88,13 @@

    Usage )

    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    newdata
    +
    newdata

    A character vector that indicates the name of the prediction data set for which predictions are desired (accessible via object$ssn.object$preds). Note that the prediction data must be in the original SSN object used to fit the model. @@ -86,22 +104,22 @@

    Argumentsse.fit +
    se.fit

    A logical indicating if standard errors are returned. The default is FALSE.

    -
    interval
    +
    interval

    Type of interval calculation. The default is "none". Other options are "confidence" (for confidence intervals) and "prediction" (for prediction intervals).

    -
    level
    +
    level

    Tolerance/confidence level. The default is 0.95.

    -
    block
    +
    block

    A logical indicating whether a block prediction over the entire region in newdata should be returned. The default is FALSE, which returns point predictions for each location in newdata. Currently only available for @@ -109,36 +127,40 @@

    Arguments.

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    type
    +
    type

    The scale (response or link) of predictions obtained using ssn_glm objects.

    -
    newdata_size
    +
    newdata_size

    The size value for each observation in newdata used when predicting for the binomial family.

    -
    var_correct
    +
    var_correct

    A logical indicating whether to return the corrected prediction variances when predicting via models fit using ssn_glm. The default is TRUE.

    -
    -

    Value

    -

    If se.fit is FALSE, predict.ssn() returns +

    +

    Value

    + + +

    If se.fit is FALSE, predict.ssn() returns a vector of predictions or a matrix of predictions with column names -fit, lwr, and upr if interval is "confidence" -or "prediction". If se.fit is TRUE, a list with the following components is returned:

    • fit: vector or matrix as above

    • +fit, lwr, and upr if interval is "confidence"

      + + +

      or "prediction". If se.fit is TRUE, a list with the following components is returned:

      • fit: vector or matrix as above

      • se.fit: standard error of each fit

    -
    -

    Details

    +
    +

    Details

    The (empirical) best linear unbiased predictions (i.e., Kriging predictions) at each site are returned when interval is "none" or "prediction" alongside standard errors. Prediction intervals @@ -147,8 +169,8 @@

    Details

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -215,23 +237,27 @@ 

    Examples#> 3.9415182 11.1746028 0.6856936 5.8826486 6.5147241 -0.1986592 5.0538075

    -
    +
    + +
    -
    + + diff --git a/docs/reference/print.SSN.html b/docs/reference/print.SSN.html index 1fe9d34..a27e6f8 100644 --- a/docs/reference/print.SSN.html +++ b/docs/reference/print.SSN.html @@ -1,86 +1,110 @@ -Print SSN object — print.SSN • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Print information about the data found in an SSN object.

    -
    -

    Usage

    -
    # S3 method for class 'SSN'
    +    
    +
    # S3 method for SSN
     print(x, ...)
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    An SSN object.

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    Print summary to console

    +
    +

    Value

    + + +

    Print summary to console

    -
    +
    + +
    -
    - +
    + + diff --git a/docs/reference/print.SSN2.html b/docs/reference/print.SSN2.html index 9f3af53..dd6c691 100644 --- a/docs/reference/print.SSN2.html +++ b/docs/reference/print.SSN2.html @@ -1,55 +1,75 @@ -Print values — print.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Print fitted model objects and summaries.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     print(x, digits = max(3L, getOption("digits") - 3L), ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     print(x, digits = max(3L, getOption("digits") - 3L), ...)
     
    -# S3 method for class 'summary.ssn_lm'
    +# S3 method for summary.ssn_lm
     print(
       x,
       digits = max(3L, getOption("digits") - 3L),
    @@ -57,7 +77,7 @@ 

    Usage ... ) -# S3 method for class 'summary.ssn_glm' +# S3 method for summary.ssn_glm print( x, digits = max(3L, getOption("digits") - 3L), @@ -65,7 +85,7 @@

    Usage ... ) -# S3 method for class 'anova.ssn_lm' +# S3 method for anova.ssn_lm print( x, digits = max(getOption("digits") - 2L, 3L), @@ -73,7 +93,7 @@

    Usage ... ) -# S3 method for class 'anova.ssn_glm' +# S3 method for anova.ssn_glm print( x, digits = max(getOption("digits") - 2L, 3L), @@ -82,49 +102,53 @@

    Usage )

    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    A fitted model object from ssn_lm(), a fitted model object from ssn_glm(), or output from summary(x) or or anova(x).

    -
    digits
    +
    digits

    The number of significant digits to use when printing.

    -
    ...
    +
    ...

    Other arguments passed to or from other methods.

    -
    signif.stars
    +
    signif.stars

    Logical. If TRUE, significance stars are printed for each coefficient

    -
    -

    Value

    -

    Printed fitted model objects and summaries with formatting.

    +
    +

    Value

    + + +

    Printed fitted model objects and summaries with formatting.

    -
    +
    + +
    -
    - +
    + + diff --git a/docs/reference/pseudoR2.SSN2.html b/docs/reference/pseudoR2.SSN2.html index 5ec3c13..e7901bd 100644 --- a/docs/reference/pseudoR2.SSN2.html +++ b/docs/reference/pseudoR2.SSN2.html @@ -1,79 +1,99 @@ -Compute a pseudo r-squared — pseudoR2.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Compute a pseudo r-squared for a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     pseudoR2(object, adjust = FALSE, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     pseudoR2(object, adjust = FALSE, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    adjust
    +
    adjust

    A logical indicating whether the pseudo r-squared should be adjusted to account for the number of explanatory variables. The default is FALSE.

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    The pseudo r-squared as a numeric vector.

    +
    +

    Value

    + + +

    The pseudo r-squared as a numeric vector.

    -
    -

    Details

    +
    +

    Details

    Several pseudo r-squared statistics exist for in the literature. We define this pseudo r-squared as one minus the ratio of the deviance of a full model relative to the deviance of a null (intercept only) model. This pseudo r-squared @@ -83,8 +103,8 @@

    Details

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -102,23 +122,27 @@ 

    Examples#> [1] 0.5854895

    -
    +
    + +
    -
    + + diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html index 1dd3aa6..aa9eb89 100644 --- a/docs/reference/reexports.html +++ b/docs/reference/reexports.html @@ -1,5 +1,5 @@ -Objects exported from other packages — reexports • SSN2Objects exported from other packages — reexports • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    These objects are imported from other packages. Follow the links below to see their documentation.

    generics
    @@ -67,29 +77,34 @@

    Objects exported from other packages

    spmodel
    -

    AICc, covmatrix, dispersion_initial, dispersion_params, glances, loocv, pseudoR2, randcov_initial, randcov_params, varcomp

    +

    AICc, covmatrix, dispersion_initial, dispersion_params, glances, loocv, pseudoR2, randcov_initial, randcov_params, varcomp

    -
    +
    + +
    -
    - +
    + + diff --git a/docs/reference/residuals.SSN2.html b/docs/reference/residuals.SSN2.html index 6ac8ac4..55471f5 100644 --- a/docs/reference/residuals.SSN2.html +++ b/docs/reference/residuals.SSN2.html @@ -1,79 +1,96 @@ -Extract fitted model residuals — residuals.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Extract residuals from a fitted model object. resid is an alias.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     residuals(object, type = "response", ...)
     
    -# S3 method for class 'ssn_lm'
    +# S3 method for ssn_lm
     resid(object, type = "response", ...)
     
    -# S3 method for class 'ssn_lm'
    +# S3 method for ssn_lm
     rstandard(model, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     residuals(object, type = "deviance", ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     resid(object, type = "deviance", ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     rstandard(model, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    type
    +
    type

    "response" for response residuals, "pearson" for Pearson residuals, or "standardized" for standardized residuals. For ssn_lm() fitted model objects, the default is "response". @@ -81,20 +98,22 @@

    Arguments) and are the default residual type.

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    model
    +
    model

    A fitted model object from ssn_lm() or ssn_glm().

    -
    -

    Value

    -

    The residuals as a numeric vector.

    +
    +

    Value

    + + +

    The residuals as a numeric vector.

    -
    -

    Details

    +
    +

    Details

    The response residuals are taken as the response minus the fitted values for the response: \(y - X \hat{\beta}\). The Pearson residuals are the response residuals pre-multiplied by their inverse square root. @@ -104,8 +123,8 @@

    Detailsrstandard() is an alias for residuals(model, type = "standardized").

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -172,23 +191,27 @@ 

    Examples#> 0.41832097 -1.69498836 -2.69823469

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_create_distmat.html b/docs/reference/ssn_create_distmat.html index 8a533ac..7faff88 100644 --- a/docs/reference/ssn_create_distmat.html +++ b/docs/reference/ssn_create_distmat.html @@ -1,54 +1,72 @@ -Calculate Hydrologic Distances for an SSN object — ssn_create_distmat • SSN2Calculate Hydrologic Distances for an SSN object — ssn_create_distmat • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Creates a collection of (non-symmetric) matrices containing pairwise downstream hydrologic distances between sites in an SSN object

    -
    -

    Usage

    +
    ssn_create_distmat(
       ssn.object,
       predpts = NULL,
    @@ -58,44 +76,44 @@ 

    Usage )

    -
    -

    Arguments

    - - -
    ssn.object
    +
    +

    Arguments

    +
    ssn.object

    An SSN object

    -
    predpts
    +
    predpts

    name of prediction points in an SSN object. When a vector with length greater than one, each name is iterated upon. Default is NULL.

    -
    overwrite
    +
    overwrite

    Logical. If TRUE, overwrite existing distance matrices. Defaults to FALSE.

    -
    among_predpts
    +
    among_predpts

    Logical. If TRUE, compute the pairwise distances between the prediction sites. Defaults to FALSE.

    -
    only_predpts
    +
    only_predpts

    Logical. If TRUE, only compute distances for prediction sites. Defaults to FALSE.

    -
    -

    Value

    -

    The ssn_create_distmat function creates a collection +

    +

    Value

    + + +

    The ssn_create_distmat function creates a collection of hierarchical directories in the ssn$path directory, which store the pairwise distances between sites associated with the SSN object. See details section for additional information.

    -
    -

    Details

    +
    +

    Details

    A distance matrix that contains the hydrologic distance between any two sites in SSN object is needed to fit a spatial statistical model using the tail-up and tail-down autocovariance @@ -177,8 +195,8 @@

    Detailsamong_predpts = TRUE.

    -
    -

    Examples

    +
    +

    Examples

    ## Copy the MiddleForke04.ssn data to a local temporary directory.
     ## Only needed for this example.
     copy_lsn_to_temp()
    @@ -204,23 +222,27 @@ 

    Examples)

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_get_data.html b/docs/reference/ssn_get_data.html index 4fc7ff3..92eced2 100644 --- a/docs/reference/ssn_get_data.html +++ b/docs/reference/ssn_get_data.html @@ -1,77 +1,95 @@ -Get a data.frame from an SSN, ssn_lm, or ssn_glm object — ssn_get_data • SSN2Get a data.frame from an SSN, ssn_lm, or ssn_glm object — ssn_get_data • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    The ssn_get_data function extracts an sf data.frame for the observation or prediction data from an SSN, ssn_lm, or ssn_glm object.

    -
    -

    Usage

    +
    ssn_get_data(x, name = "obs")
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    An object of class SSN, ssn_lm, or ssn_glm.

    -
    name
    +
    name

    the internal name of the dataset in the object x. For observed values, this will always be "obs", the default.

    -
    -

    Value

    -

    An sf data.frame

    +
    +

    Value

    + + +

    An sf data.frame

    -
    -

    Details

    +
    +

    Details

    The internal name for observed data in objects of class SSN is "obs" and it is the default. If another name is specified, it must represent a @@ -81,13 +99,13 @@

    Detailsnames(x$ssn.object$preds).

    -
    -

    See also

    +
    +

    See also

    -
    -

    Examples

    +
    +

    Examples

    ## Extract observed data from an SSN object
     # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
    @@ -170,23 +188,27 @@ 

    Examples#>

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_get_netgeom.html b/docs/reference/ssn_get_netgeom.html index dbcb5d5..528aafc 100644 --- a/docs/reference/ssn_get_netgeom.html +++ b/docs/reference/ssn_get_netgeom.html @@ -1,61 +1,79 @@ -Extract netgeom column — ssn_get_netgeom • SSN2 - Skip to contents +Extract netgeom column — ssn_get_netgeom • SSN2 + +
    +
    -
    -
    -
    +
    + -
    +

    Extract topological information from netgeom column

    -
    -

    Usage

    +
    ssn_get_netgeom(x, netvars = "all", reformat = FALSE)
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    An sf data.frame found in an SSN object or the netgeom column as a vector

    -
    netvars
    +
    netvars

    Network coordinate variables to return. Default is "all". For edges, valid column names include: "NetworkID", "SegmentID", and "DistanceUpstream". For point datasets, valid column @@ -63,18 +81,20 @@

    Arguments

    -
    reformat
    +
    reformat

    Convert network coordinate variables from character to numeric.

    -
    -

    Value

    -

    If more than one column is requested using netvars, the +

    +

    Value

    + + +

    If more than one column is requested using netvars, the function returns a data.frame (default). If only one column is requested, the result is a vector.

    -
    -

    Details

    +
    +

    Details

    When an SSN object is generated using the importSSN function, a text column named "netgeom" is added to the edges, observed sites, and prediction sites (if they @@ -92,8 +112,8 @@

    Detailsnetvars.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -315,23 +335,27 @@ 

    Examples#> 163 7466.07885573737

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_get_stream_distmat.html b/docs/reference/ssn_get_stream_distmat.html index 5714fde..57f70e9 100644 --- a/docs/reference/ssn_get_stream_distmat.html +++ b/docs/reference/ssn_get_stream_distmat.html @@ -1,63 +1,80 @@ -Get stream distance matrices from an SSN object — ssn_get_stream_distmat • SSN2 - Skip to contents +Get stream distance matrices from an SSN object — ssn_get_stream_distmat • SSN2 + +
    +
    -
    -
    -
    +
    + -
    +

    Extracts the stream network distance matrices for the observation or prediction data from an SSN object.

    -
    -

    Usage

    +
    ssn_get_stream_distmat(x, name = "obs")
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    An SSN object

    -
    name
    +
    name

    Internal name of the dataset in the object x. For observed values, this will always be "obs", the default. To get a stream network distance matrix for a @@ -65,13 +82,15 @@

    Arguments -

    Value

    -

    A list of asymmetric downstream only +

    +

    Value

    + + +

    A list of asymmetric downstream only stream distance matrices, by network.

    -
    -

    Details

    +
    +

    Details

    The internal name for observed data in objects of class SSN is "obs" and it is the default. If another name is specified, it must represent a prediction data set in the @@ -127,20 +146,20 @@

    Details

    -
    -

    References

    +
    +

    References

    Ver Hoef, J.M. and Peterson, E.E. (2010) A moving average approach to spatial statistical models of stream networks. The Journal of the American Statistical Association, -105(489), 22–24

    +105(489), 22--24

    -
    -

    See also

    + -
    -

    Examples

    +
    +

    Examples

    ## For this example only, copy MiddleFork04.ssn directory to R's
     ## temporary directory
     copy_lsn_to_temp()
    @@ -151,12 +170,12 @@ 

    Examples ## Create distance matrices for obs x obs, obs x preds, and preds x ## preds -if (FALSE) { # \dontrun{ +if (FALSE) { ssn_create_distmat(mf04p, predpts = "pred1km", among_predpts = TRUE, overwrite = TRUE ) -} # } +} ## Check names of prediction datasets names(mf04p$preds) @@ -276,23 +295,27 @@

    Examples#> 50 0 0 0 1000.000 0.000

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_glm.html b/docs/reference/ssn_glm.html index e00c9d2..61556cb 100644 --- a/docs/reference/ssn_glm.html +++ b/docs/reference/ssn_glm.html @@ -1,51 +1,68 @@ -Fitting Generalized Linear Models for Spatial Stream Networks — ssn_glm • SSN2Fitting Generalized Linear Models for Spatial Stream Networks — ssn_glm • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    This function works on spatial stream network objects to fit generalized linear models with spatially autocorrelated errors using likelihood methods, allowing for non-spatial random effects, anisotropy, partition factors, big data methods, and more. @@ -53,8 +70,7 @@

    Fitting Generalized Linear Models for Spatial Stream Networks

    and Peterson and Ver Hoef (2010).

    -
    -

    Usage

    +
    ssn_glm(
       formula,
       ssn.object,
    @@ -78,21 +94,19 @@ 

    Usage )

    -
    -

    Arguments

    - - -
    formula
    +
    +

    Arguments

    +
    formula

    A two-sided linear formula describing the fixed effect structure of the model, with the response to the left of the ~ operator and the terms on the right, separated by + operators.

    -
    ssn.object
    +
    ssn.object

    A spatial stream network object with class SSN.

    -
    family
    +
    family

    The generalized linear model family for use with ssn_glm(). Available options include "Gaussian", "poisson", "nbinomial" (negative binomial), "binomial", "beta", @@ -103,21 +117,21 @@

    Argumentstailup_type +
    tailup_type

    The tailup covariance function type. Available options include "linear", "spherical", "exponential", "mariah", "epa", and "none". Parameterizations are described in Details.

    -
    taildown_type
    +
    taildown_type

    The taildown covariance function type. Available options include "linear", "spherical", "exponential", "mariah", "epa", and "none". Parameterizations are described in Details.

    -
    euclid_type
    +
    euclid_type

    The euclidean covariance function type. Available options include "spherical", "exponential", "gaussian", "cosine", "cubic", "pentaspherical", "wave", @@ -126,38 +140,38 @@

    Argumentsnugget_type +
    nugget_type

    The nugget covariance function type. Available options include "nugget" or "none". Parameterizations are described in Details.

    -
    tailup_initial
    +
    tailup_initial

    An object from tailup_initial() specifying initial and/or known values for the tailup covariance parameters.

    -
    taildown_initial
    +
    taildown_initial

    An object from taildown_initial() specifying initial and/or known values for the taildown covariance parameters.

    -
    euclid_initial
    +
    euclid_initial

    An object from euclid_initial() specifying initial and/or known values for the euclidean covariance parameters.

    -
    nugget_initial
    +
    nugget_initial

    An object from nugget_initial() specifying initial and/or known values for the nugget covariance parameters.

    -
    dispersion_initial
    +
    dispersion_initial

    An object from dispersion_initial() specifying initial and/or known values for the tailup covariance parameters.

    -
    additive
    +
    additive

    The name of the variable in ssn.object that is used to define spatial weights. Can be quoted or unquoted. For the tailup covariance functions, these additive weights are used for branching. Technical details that describe the role @@ -165,13 +179,13 @@

    Argumentsestmethod +
    estmethod

    The estimation method. Available options include "reml" for restricted maximum likelihood and "ml" for maximum likelihood. The default is "reml".

    -
    anisotropy
    +
    anisotropy

    A logical indicating whether (geometric) anisotropy should be modeled. Not required if spcov_initial is provided with 1) rotate assumed unknown or assumed known and non-zero or 2) scale assumed unknown @@ -179,7 +193,7 @@

    Argumentsrandom +
    random

    A one-sided linear formula describing the random effect structure of the model. Terms are specified to the right of the ~ operator. Each term has the structure x1 + ... + xn | g1/.../gm, where x1 + ... + xn @@ -195,24 +209,26 @@

    Argumentsrandcov_initial +
    randcov_initial

    An optional object specifying initial and/or known values for the random effect variances. See spmodel::randcov_initial().

    -
    partition_factor
    +
    partition_factor

    A one-sided linear formula with a single term specifying the partition factor. The partition factor assumes observations from different levels of the partition factor are uncorrelated.

    -
    ...
    +
    ...

    Other arguments to stats::optim().

    -
    -

    Value

    -

    A list with many elements that store information about +

    +

    Value

    + + +

    A list with many elements that store information about the fitted model object and has class ssn_glm. Many generic functions that summarize model fit are available for ssn_glm objects, including AIC, AICc, anova, augment, coef, @@ -221,6 +237,8 @@

    Value

    labels, logLik, loocv, model.frame, model.matrix, plot, predict, print, pseudoR2, summary, terms, tidy, update, varcomp, and vcov.

    + +

    This fitted model list contains the following elements:

    • additive: The name of the additive function value column.

    • anisotropy: Whether euclidean anisotropy was modeled.

    • call: The function call.

    • @@ -265,8 +283,8 @@

      Value

      object$residuals.

    -
    -

    Details

    +
    +

    Details

    The generalized linear model for spatial stream networks can be written as \(g(\mu) = \eta = X \beta + zu + zd + ze + n\), where \(\mu\) is the expectation of the response given the random errors, \(y\), \(g()\) is a function that links the mean @@ -418,29 +436,29 @@

    Detailspredict(object).

    -
    -

    Note

    +
    +

    Note

    This function does not perform any internal scaling. If optimization is not stable due to large extremely large variances, scale relevant variables so they have variance 1 before optimization.

    -
    -

    References

    +
    +

    References

    Garreta, V., Monestiez, P. and Ver Hoef, J.M. (2010) Spatial modelling and prediction on river networks: up model, down model, or hybrid? -Environmetrics 21(5), 439–456.

    +Environmetrics 21(5), 439--456.

    McCullagh P. and Nelder, J. A. (1989) Generalized Linear Models. London: Chapman and Hall.

    Peterson, E.E. and Ver Hoef, J.M. (2010) A mixed-model moving-average approach to geostatistical modeling in stream networks. Ecology 91(3), -644–651.

    +644--651.

    Ver Hoef, J.M. and Peterson, E.E. (2010) A moving average approach for spatial statistical models of stream networks (with discussion). -Journal of the American Statistical Association 105, 6–18. -DOI: 10.1198/jasa.2009.ap08248. Rejoinder pgs. 22–24.

    +Journal of the American Statistical Association 105, 6--18. +DOI: 10.1198/jasa.2009.ap08248. Rejoinder pgs. 22--24.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -484,23 +502,27 @@ 

    Examples

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_import.html b/docs/reference/ssn_import.html index 45629e2..6120ca8 100644 --- a/docs/reference/ssn_import.html +++ b/docs/reference/ssn_import.html @@ -1,82 +1,101 @@ -Import SSN object — ssn_import • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    This function reads spatial data from a .ssn folder and creates an SSN object.

    -
    -

    Usage

    +
    ssn_import(path, include_obs = TRUE, predpts = NULL, overwrite = FALSE)
    -
    -

    Arguments

    - - -
    path
    +
    +

    Arguments

    +
    path

    Filepath to the .ssn directory. See details.

    -
    include_obs
    +
    include_obs

    default = TRUE. Logical indicating whether observed sites should be included in the SSN object.

    -
    predpts
    +
    predpts

    Vector of prediction site dataset names found within the .ssn folder. See details.

    -
    overwrite
    +
    overwrite

    default = FALSE. If TRUE, overwrite existing binaryID.db files and netgeom column(s) if it exists in the edges, observed sites (if include_obs = TRUE), and prediction site datasets (if they exist).

    -
    -

    Value

    -

    ssn_import returns an object of class SSN, which is a list +

    +

    Value

    + + +

    ssn_import returns an object of class SSN, which is a list with four elements containing:

    • edges: An sf data.frame containing the stream network, with an additional 'netgeom' column.

    • obs: An sf data.frame containing observed site locations, @@ -87,8 +106,8 @@

      Value

      path: The local filepath for the .ssn directory associated with the SSN object.

    -
    -

    Details

    +
    +

    Details

    The ssn_import function imports spatial data (shapefile or GeoPackage format) from a .ssn folder generated using the SSNbler package function SSNbler::lsn_to_ssn. The .ssn folder contains all of the spatial, topological and @@ -140,17 +159,17 @@

    DetailsSSN object.

    -
    -

    References

    +
    +

    References

    Peterson, E., and Ver Hoef, J.M. (2014) STARS: An ArcGIS toolset used to calculate the spatial information needed to fit spatial statistical stream network models to stream network data. Journal of Statistical Software -56(2), 1–17.

    +56(2), 1--17.

    -
    -

    Examples

    +
    +

    Examples

    ## Create local temporary copy of MiddleFork04.ssn found in
     # SSN2/lsndata folder. Only necessary for this example.
     copy_lsn_to_temp()
    @@ -171,23 +190,27 @@ 

    Examples

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_import_predpts.html b/docs/reference/ssn_import_predpts.html index 5c8403a..cbbbe8d 100644 --- a/docs/reference/ssn_import_predpts.html +++ b/docs/reference/ssn_import_predpts.html @@ -1,78 +1,96 @@ -Import prediction points into an SSN, ssn_lm, or ssn_glm object — ssn_import_predpts • SSN2Import prediction points into an SSN, ssn_lm, or ssn_glm object — ssn_import_predpts • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    A shapefile of prediction points found in the .ssn directory are imported into an existing object of class SSN, ssn_lm, or ssn_glm.

    -
    -

    Usage

    +
    ssn_import_predpts(x, predpts)
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    An object of classSSN, ssn_lm, or ssn_glm.

    -
    predpts
    +
    predpts

    Name of the prediction point dataset to import in character format. See details.

    -
    -

    Value

    -

    an object of class SSN, ssn_lm, or +

    +

    Value

    + + +

    an object of class SSN, ssn_lm, or ssn_glm which contains the new prediction dataset.

    -
    -

    Details

    +
    +

    Details

    ssn_import_predpts imports one set of prediction points residing in the .ssn directory into an existing SSN, ssn_lm, or ssn_glm object. The @@ -102,8 +120,8 @@

    Details

    -
    -

    Examples

    +
    +

    Examples

    ## Create local temporary copy of MiddleFork04.ssn found in
     # SSN2/lsndata folder. Only necessary for this example.
     copy_lsn_to_temp()
    @@ -133,23 +151,27 @@ 

    Examples

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_initial.html b/docs/reference/ssn_initial.html index f772b8e..de56436 100644 --- a/docs/reference/ssn_initial.html +++ b/docs/reference/ssn_initial.html @@ -1,57 +1,74 @@ -Create a covariance parameter initial object — ssn_initial • SSN2Create a covariance parameter initial object — ssn_initial • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Create a covariance parameter initial object that specifies initial and/or known values to use while estimating specific covariance parameters with ssn_lm() or ssn_glm(). See spmodel::randcov_initial() for documentation regarding random effect covariance parameter initial objects.

    -
    -

    Usage

    +
    tailup_initial(tailup_type, de, range, known)
     
     taildown_initial(taildown_type, de, range, known)
    @@ -61,38 +78,36 @@ 

    Usage nugget_initial(nugget_type, nugget, known)

    -
    -

    Arguments

    - - -
    tailup_type
    +
    +

    Arguments

    +
    tailup_type

    The tailup covariance function type. Available options include "linear", "spherical", "exponential", "mariah", "epa", and "none".

    -
    de
    +
    de

    The spatially dependent (correlated) random error variance. Commonly referred to as a partial sill.

    -
    range
    +
    range

    The correlation parameter.

    -
    known
    +
    known

    A character vector indicating which covariance parameters are to be assumed known. The value "given" is shorthand for assuming all covariance parameters given to *_initial() are assumed known.

    -
    taildown_type
    +
    taildown_type

    The taildown covariance function type. Available options include "linear", "spherical", "exponential", "mariah", "epa", and "none".

    -
    euclid_type
    +
    euclid_type

    The euclidean covariance function type. Available options include "spherical", "exponential", "gaussian", "cosine", "cubic", "pentaspherical", "wave", @@ -100,37 +115,39 @@

    Arguments.

    -
    rotate
    +
    rotate

    Anisotropy rotation parameter (from 0 to \(\pi\) radians) for the euclidean portion of the covariance. A value of 0 (the default) implies no rotation.

    -
    scale
    +
    scale

    Anisotropy scale parameter (from 0 to 1) for the euclidean portion of the covariance. A value of 1 (the default) implies no scaling.

    -
    nugget_type
    +
    nugget_type

    The nugget covariance function type. Available options include "nugget" or "none".

    -
    nugget
    +
    nugget

    The spatially independent (not correlated) random error variance. Commonly referred to as a nugget.

    -
    -

    Value

    -

    A list with two elements: initial and is_known. +

    +

    Value

    + + +

    A list with two elements: initial and is_known. initial is a named numeric vector indicating the spatial covariance parameters with specified initial and/or known values. is_known is a named numeric vector indicating whether the spatial covariance parameters in initial are known or not. The class of the list matches the the relevant spatial covariance type.

    -
    -

    Details

    +
    +

    Details

    Create an initial object for use with ssn_lm() or ssn_glm(). NA values can be given for ie, rotate, and scale, which lets these functions find initial values for parameters that are sometimes @@ -194,19 +211,19 @@

    DetailsDispersion and random effect initial objects are specified via spmodel::dispersion_initial() and spmodel::randcov_initial(), respectively.

    -
    -

    References

    +
    +

    References

    Peterson, E.E. and Ver Hoef, J.M. (2010) A mixed-model moving-average approach to geostatistical modeling in stream networks. Ecology 91(3), -644–651.

    +644--651.

    Ver Hoef, J.M. and Peterson, E.E. (2010) A moving average approach for spatial statistical models of stream networks (with discussion). -Journal of the American Statistical Association 105, 6–18. -DOI: 10.1198/jasa.2009.ap08248. Rejoinder pgs. 22–24.

    +Journal of the American Statistical Association 105, 6--18. +DOI: 10.1198/jasa.2009.ap08248. Rejoinder pgs. 22--24.

    -
    -

    Examples

    +
    +

    Examples

    tailup_initial("exponential", de = 1, range = 20, known = "range")
     #> $initial
     #>    de range 
    @@ -254,23 +271,27 @@ 

    Examples

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_lm.html b/docs/reference/ssn_lm.html index 9f4cdd5..a0eede8 100644 --- a/docs/reference/ssn_lm.html +++ b/docs/reference/ssn_lm.html @@ -1,51 +1,68 @@ -Fitting Linear Models for Spatial Stream Networks — ssn_lm • SSN2Fitting Linear Models for Spatial Stream Networks — ssn_lm • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    This function works on spatial stream network objects to fit linear models with spatially autocorrelated errors using likelihood methods, allowing for non-spatial random effects, anisotropy, partition factors, big data methods, and more. @@ -53,8 +70,7 @@

    Fitting Linear Models for Spatial Stream Networks

    and Peterson and Ver Hoef (2010).

    -
    -

    Usage

    +
    ssn_lm(
       formula,
       ssn.object,
    @@ -76,35 +92,33 @@ 

    Usage )

    -
    -

    Arguments

    - - -
    formula
    +
    +

    Arguments

    +
    formula

    A two-sided linear formula describing the fixed effect structure of the model, with the response to the left of the ~ operator and the terms on the right, separated by + operators.

    -
    ssn.object
    +
    ssn.object

    A spatial stream network object with class SSN.

    -
    tailup_type
    +
    tailup_type

    The tailup covariance function type. Available options include "linear", "spherical", "exponential", "mariah", "epa", and "none". Parameterizations are described in Details.

    -
    taildown_type
    +
    taildown_type

    The taildown covariance function type. Available options include "linear", "spherical", "exponential", "mariah", "epa", and "none". Parameterizations are described in Details.

    -
    euclid_type
    +
    euclid_type

    The euclidean covariance function type. Available options include "spherical", "exponential", "gaussian", "cosine", "cubic", "pentaspherical", "wave", @@ -113,33 +127,33 @@

    Argumentsnugget_type +
    nugget_type

    The nugget covariance function type. Available options include "nugget" or "none". Parameterizations are described in Details.

    -
    tailup_initial
    +
    tailup_initial

    An object from tailup_initial() specifying initial and/or known values for the tailup covariance parameters.

    -
    taildown_initial
    +
    taildown_initial

    An object from taildown_initial() specifying initial and/or known values for the taildown covariance parameters.

    -
    euclid_initial
    +
    euclid_initial

    An object from euclid_initial() specifying initial and/or known values for the euclidean covariance parameters.

    -
    nugget_initial
    +
    nugget_initial

    An object from nugget_initial() specifying initial and/or known values for the nugget covariance parameters.

    -
    additive
    +
    additive

    The name of the variable in ssn.object that is used to define spatial weights. Can be quoted or unquoted. For the tailup covariance functions, these additive weights are used for branching. Technical details that describe the role @@ -147,13 +161,13 @@

    Argumentsestmethod +
    estmethod

    The estimation method. Available options include "reml" for restricted maximum likelihood and "ml" for maximum likelihood. The default is "reml".

    -
    anisotropy
    +
    anisotropy

    A logical indicating whether (geometric) anisotropy should be modeled. Not required if spcov_initial is provided with 1) rotate assumed unknown or assumed known and non-zero or 2) scale assumed unknown @@ -161,7 +175,7 @@

    Argumentsrandom +
    random

    A one-sided linear formula describing the random effect structure of the model. Terms are specified to the right of the ~ operator. Each term has the structure x1 + ... + xn | g1/.../gm, where x1 + ... + xn @@ -177,24 +191,26 @@

    Argumentsrandcov_initial +
    randcov_initial

    An optional object specifying initial and/or known values for the random effect variances. See spmodel::randcov_initial().

    -
    partition_factor
    +
    partition_factor

    A one-sided linear formula with a single term specifying the partition factor. The partition factor assumes observations from different levels of the partition factor are uncorrelated.

    -
    ...
    +
    ...

    Other arguments to stats::optim().

    -
    -

    Value

    -

    A list with many elements that store information about +

    +

    Value

    + + +

    A list with many elements that store information about the fitted model object and has class ssn_lm. Many generic functions that summarize model fit are available for ssn_lm objects, including AIC, AICc, anova, augment, coef, @@ -203,6 +219,8 @@

    Value

    labels, logLik, loocv, model.frame, model.matrix, plot, predict, print, pseudoR2, summary, terms, tidy, update, varcomp, and vcov.

    + +

    This fitted model list contains the following elements:

    • additive: The name of the additive function value column.

    • anisotropy: Whether euclidean anisotropy was modeled.

    • call: The function call.

    • @@ -244,8 +262,8 @@

      Value

      object$residuals.

    -
    -

    Details

    +
    +

    Details

    The linear model for spatial stream networks can be written as \(y = X \beta + zu + zd + ze + n\), where \(X\) is the fixed effects design matrix, \(\beta\) are the fixed effects, \(zu\) is tailup random error, @@ -345,28 +363,28 @@

    Detailspredict(object).

    -
    -

    Note

    +
    +

    Note

    This function does not perform any internal scaling. If optimization is not stable due to large extremely large variances, scale relevant variables so they have variance 1 before optimization.

    -
    -

    References

    +
    +

    References

    Garreta, V., Monestiez, P. and Ver Hoef, J.M. (2010) Spatial modelling and prediction on river networks: up model, down model, or hybrid? -Environmetrics 21(5), 439–456.

    +Environmetrics 21(5), 439--456.

    Peterson, E.E. and Ver Hoef, J.M. (2010) A mixed-model moving-average approach to geostatistical modeling in stream networks. Ecology 91(3), -644–651.

    +644--651.

    Ver Hoef, J.M. and Peterson, E.E. (2010) A moving average approach for spatial statistical models of stream networks (with discussion). -Journal of the American Statistical Association 105, 6–18. -DOI: 10.1198/jasa.2009.ap08248. Rejoinder pgs. 22–24.

    +Journal of the American Statistical Association 105, 6--18. +DOI: 10.1198/jasa.2009.ap08248. Rejoinder pgs. 22--24.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -408,23 +426,27 @@ 

    Examples

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_names.html b/docs/reference/ssn_names.html index 08c33a9..890294f 100644 --- a/docs/reference/ssn_names.html +++ b/docs/reference/ssn_names.html @@ -1,84 +1,107 @@ -Return names of data in an SSN object — ssn_names • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Extract and print names from the edges, sites and preds elements of an SSN object.

    -
    -

    Usage

    +
    ssn_names(ssn.object)
    -
    -

    Arguments

    - - -
    ssn.object
    +
    +

    Arguments

    +
    ssn.object

    An SSN object.

    -
    -

    Value

    -

    Print variable names to console

    +
    +

    Value

    + + +

    Print variable names to console

    -
    +
    + +
    -
    - +
    + + diff --git a/docs/reference/ssn_params.html b/docs/reference/ssn_params.html index af40eda..32a3fd9 100644 --- a/docs/reference/ssn_params.html +++ b/docs/reference/ssn_params.html @@ -1,54 +1,72 @@ -Create covariance parameter objects. — ssn_params • SSN2Create covariance parameter objects. — ssn_params • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Create a covariance parameter object for us with other functions. See spmodel::randcov_params() for documentation regarding random effect covariance parameter objects.

    -
    -

    Usage

    +
    tailup_params(tailup_type, de, range)
     
     taildown_params(taildown_type, de, range)
    @@ -58,32 +76,30 @@ 

    Usage nugget_params(nugget_type, nugget)

    -
    -

    Arguments

    - - -
    tailup_type
    +
    +

    Arguments

    +
    tailup_type

    The tailup covariance function type. Available options include "linear", "spherical", "exponential", "mariah", "epa", and "none".

    -
    de
    +
    de

    The spatially dependent (correlated) random error variance. Commonly referred to as a partial sill.

    -
    range
    +
    range

    The correlation parameter.

    -
    taildown_type
    +
    taildown_type

    The taildown covariance function type. Available options include "linear", "spherical", "exponential", "mariah", "epa", and "none".

    -
    euclid_type
    +
    euclid_type

    The euclidean covariance function type. Available options include "spherical", "exponential", "gaussian", "cosine", "cubic", "pentaspherical", "wave", @@ -91,43 +107,45 @@

    Arguments.

    -
    rotate
    +
    rotate

    Anisotropy rotation parameter (from 0 to \(\pi\) radians) for the euclidean portion of the covariance. A value of 0 (the default) implies no rotation.

    -
    scale
    +
    scale

    Anisotropy scale parameter (from 0 to 1) for the euclidean portion of the covariance. A value of 1 (the default) implies no scaling.

    -
    nugget_type
    +
    nugget_type

    The nugget covariance function type. Available options include "nugget" or "none".

    -
    nugget
    +
    nugget

    The spatially independent (not correlated) random error variance. Commonly referred to as a nugget.

    -
    -

    Value

    -

    A parameter object with class that matches the relevant type argument.

    +
    +

    Value

    + + +

    A parameter object with class that matches the relevant type argument.

    -
    -

    References

    +
    +

    References

    Peterson, E.E. and Ver Hoef, J.M. (2010) A mixed-model moving-average approach to geostatistical modeling in stream networks. Ecology 91(3), -644–651.

    +644--651.

    Ver Hoef, J.M. and Peterson, E.E. (2010) A moving average approach for spatial statistical models of stream networks (with discussion). -Journal of the American Statistical Association 105, 6–18. -DOI: 10.1198/jasa.2009.ap08248. Rejoinder pgs. 22–24.

    +Journal of the American Statistical Association 105, 6--18. +DOI: 10.1198/jasa.2009.ap08248. Rejoinder pgs. 22--24.

    -
    -

    Examples

    +
    +

    Examples

    tailup_params("exponential", de = 1, range = 20)
     #>    de range 
     #>     1    20 
    @@ -150,23 +168,27 @@ 

    Examples#> [1] "nugget_nugget"

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_put_data.html b/docs/reference/ssn_put_data.html index 97ed0c7..e48369f 100644 --- a/docs/reference/ssn_put_data.html +++ b/docs/reference/ssn_put_data.html @@ -1,88 +1,106 @@ -Put an sf data.frame in an SSN object — ssn_put_data • SSN2Put an sf data.frame in an SSN object — ssn_put_data • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    The ssn_put_data function puts an sf data.frame representing observation or prediction data into an SSN, ssn_lm, or ssn_glm object.

    -
    -

    Usage

    +
    ssn_put_data(data, x, name = "obs", resize_data = FALSE)
    -
    -

    Arguments

    - - -
    data
    +
    +

    Arguments

    +
    data

    sf data.frame with point geometry.

    -
    x
    +
    x

    An object of class SSN, ssn_lm, or ssn_glm.

    -
    name
    +
    name

    the internal name of the data set in the object x. For observed data, this will always be "obs", the default.

    -
    resize_data
    +
    resize_data

    Logical. Indicates whether sf_df can have a different number of features than the current data.frame in the object. Default is FALSE.

    -
    -

    Value

    -

    Returns an object of the same class as x, which contains +

    +

    Value

    + + +

    Returns an object of the same class as x, which contains the sf data.frame sf_data.

    -
    -

    Details

    +
    +

    Details

    The internal name for observed data in objects of class SSN, ssn_lm, and ssn_glm is "obs" and it is the default. If another name is specified, it must represent a @@ -99,13 +117,13 @@

    Details

    -
    -

    See also

    +
    +

    See also

    -
    -

    Examples

    +
    +

    Examples

    data(mf04p)
     ## Extract observation data.frame from SSN object
     obs.df <- ssn_get_data(mf04p)
    @@ -130,23 +148,27 @@ 

    Examples#> 6 15.29 15.29 POINT (-1524599 930808.7)

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_simulate.html b/docs/reference/ssn_simulate.html index f0b4cc6..85881fb 100644 --- a/docs/reference/ssn_simulate.html +++ b/docs/reference/ssn_simulate.html @@ -1,57 +1,74 @@ -Simulate random variables on a stream network — ssn_simulate • SSN2Simulate random variables on a stream network — ssn_simulate • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Simulate random variables on a stream network with a specific mean and covariance structure. Designed to use ssn_simulate(), but individual simulation functions for each resposne distribution also exist.

    -
    -

    Usage

    +
    ssn_simulate(
       family = "Gaussian",
       ssn.object,
    @@ -181,45 +198,43 @@ 

    Usage )

    -
    -

    Arguments

    - - -
    family
    +
    +

    Arguments

    +
    family

    The response distribution family. The default is "Gaussian".

    -
    ssn.object
    +
    ssn.object

    A spatial stream network object with class SSN. Random variables are simulated for each row of ssn.object$obs.

    -
    network
    +
    network

    The spatial stream network to simulate on. Currently only allowed to be "obs" for the ssn.object$obs object.

    -
    tailup_params
    +
    tailup_params

    An object from tailup_params() specifying the tailup covariance parameters.

    -
    taildown_params
    +
    taildown_params

    An object from taildown_params() specifying the taildown covariance parameters.

    -
    euclid_params
    +
    euclid_params

    An object from euclid_params() specifying the Euclidean covariance parameters.

    -
    nugget_params
    +
    nugget_params

    An object from nugget_params() specifying the nugget covariance parameters.

    -
    additive
    +
    additive

    The name of the variable in ssn.object that is used to define spatial weights. Can be quoted or unquoted. For the tailup covariance functions, these additive weights are used for branching. Technical details that describe the role @@ -227,47 +242,51 @@

    Argumentsmean +
    mean

    A numeric vector representing the mean. mean must have length 1 (in which case it is recycled) or length equal to the number of rows in data. The default is 0.

    -
    samples
    +
    samples

    The number of independent samples to generate. The default is 1.

    -
    dispersion
    +
    dispersion

    The dispersion value (if relevant).

    -
    size
    +
    size

    A numeric vector representing the sample size for each binomial trial. The default is 1, which corresponds to a Bernoulli trial for each observation.

    -
    randcov_params
    +
    randcov_params

    A spmodel::randcov_params() object.

    -
    partition_factor
    +
    partition_factor

    A formula indicating the partition factor.

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    If samples is 1, a vector of random variables for each row of ssn.object$obs -is returned. If samples is greater than one, a matrix of random variables +

    +

    Value

    + + +

    If samples is 1, a vector of random variables for each row of ssn.object$obs

    + + +

    is returned. If samples is greater than one, a matrix of random variables is returned, where the rows correspond to each row of ssn.object$obs and the columns correspond to independent samples.

    -
    -

    Details

    +
    +

    Details

    Random variables are simulated via the product of the covariance matrix's square (Cholesky) root and independent standard normal random variables on the link scale, which are then used to simulate a relevant variable on the response scale @@ -287,16 +306,16 @@

    Details

    ssn_rgamma(): Simulate from a gamma distribution

  • ssn_rinvgauss(): Simulate from an inverse Gaussian distribution

  • -
    -

    References

    +
    +

    References

    Ver Hoef, J.M. and Peterson, E.E. (2010) A moving average approach for spatial statistical models of stream networks (with discussion). -Journal of the American Statistical Association 105, 6–18. -DOI: 10.1198/jasa.2009.ap08248. Rejoinder pgs. 22–24.

    +Journal of the American Statistical Association 105, 6--18. +DOI: 10.1198/jasa.2009.ap08248. Rejoinder pgs. 22--24.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -320,23 +339,27 @@ 

    Examples

    -
    +
    + + - + + diff --git a/docs/reference/ssn_split_predpts.html b/docs/reference/ssn_split_predpts.html index ef006cb..4d1b812 100644 --- a/docs/reference/ssn_split_predpts.html +++ b/docs/reference/ssn_split_predpts.html @@ -1,53 +1,69 @@ -Split a prediction dataset in an SSN object — ssn_split_predpts • SSN2Split a prediction dataset in an SSN object — ssn_split_predpts • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    The splitPrediction function is used to split prediction sets in an SSN object into smaller prediction sets. It returns a SSN object with additional @@ -56,8 +72,7 @@

    Split a prediction dataset in an SSN object

    set, or a logical expression.

    -
    -

    Usage

    +
    ssn_split_predpts(
       ssn,
       predpts,
    @@ -71,68 +86,68 @@ 

    Usage )

    -
    -

    Arguments

    - - -
    ssn
    +
    +

    Arguments

    +
    ssn

    An SSN object.

    -
    predpts
    +
    predpts

    A character string representing the name of the prediction dataset.

    -
    size_predpts
    +
    size_predpts

    numeric value representing the size of the new prediction sets. The existing prediction set is split equally to produce multiple prediction sets of this size

    -
    by
    +
    by

    character string representing the column name of type factor, integer, character or logical that the split will be based on

    -
    subset
    +
    subset

    logical expression indicating which elements or rows to keep; missing values are taken as FALSE

    -
    id_predpts
    +
    id_predpts

    character string representing the new prediction dataset name. This value is only specified when the subset method is used

    -
    keep
    +
    keep

    logical value indicating whether the original prediction dataset should be retained in the SSN object. Default is TRUE

    -
    drop_levels
    +
    drop_levels

    logical value indicating whether empty factor levels should be dropped in the by column when the new prediction dataset(s) are created. Default is FALSE

    -
    overwrite
    +
    overwrite

    logical indicating whether the new prediction dataset geopackage should be deleted in the .ssn directory if it already exists. Default = FALSE

    -
    -

    Value

    -

    returns the SSN specified in ssn, with one or more new prediction +

    +

    Value

    + + +

    returns the SSN specified in ssn, with one or more new prediction sets. Geopackages of the new prediction sets are written to the .ssn directory designated in ssn$path.

    -
    -

    Details

    +
    +

    Details

    Three methods have been provided to split prediction sets: size, by, and subset. The size method is used to split the existing prediction @@ -160,8 +175,8 @@

    Details

    -
    -

    Examples

    +
    +

    Examples

    ## Import SSN object
     copy_lsn_to_temp() ## Only needed for this example
     ssn <- ssn_import(paste0(tempdir(), "/MiddleFork04.ssn"),
    @@ -198,23 +213,27 @@ 

    Examples#> [1] "pred1km" "CapeHorn" "RATIO_05"

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_subset.html b/docs/reference/ssn_subset.html index 116c962..263d6a0 100644 --- a/docs/reference/ssn_subset.html +++ b/docs/reference/ssn_subset.html @@ -1,91 +1,110 @@ -Subset an SSN object — ssn_subset • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Returns an SSN object that has been subset based on a logical expression.

    -
    -

    Usage

    +
    ssn_subset(ssn, path, subset, clip = FALSE, overwrite = FALSE)
    -
    -

    Arguments

    - - -
    ssn
    +
    +

    Arguments

    +
    ssn

    An SSN object.

    -
    path
    +
    path

    The filepath to the .ssn folder, in string format, where the subset SSN will be saved.

    -
    subset
    +
    subset

    A logical expression indicating which features to keep.

    -
    clip
    +
    clip

    If TRUE, create a subset of the edges and prediction sites, based on the same logical expression used to subset the observed sites. Default = FALSE.

    -
    overwrite
    +
    overwrite

    If TRUE, overwrite the folder specified in path if it exists. Default = FALSE.

    -
    -

    Value

    -

    an object of class SSN, which is stored locally in the .ssn +

    +

    Value

    + + +

    an object of class SSN, which is stored locally in the .ssn directory specified in path. It also creates and stores an SQLite database, binaryID.db, within the .ssn directory.

    -
    -

    Details

    +
    +

    Details

    This function creates a subset of the original SSN object based on a logical expression defined in the subset argument. The subset argument is treated as an expression @@ -108,8 +127,8 @@

    DetailsSSN.

    -
    -

    Examples

    +
    +

    Examples

    ## Import SSN object
     copy_lsn_to_temp() ## Only needed for this example
     mf04p <- ssn_import(paste0(tempdir(), "/MiddleFork04.ssn"),
    @@ -132,23 +151,27 @@ 

    Examples)

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_update_path.html b/docs/reference/ssn_update_path.html index 348fb18..77814a2 100644 --- a/docs/reference/ssn_update_path.html +++ b/docs/reference/ssn_update_path.html @@ -1,78 +1,97 @@ -Update path in an SSN object — ssn_update_path • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Update the local path in an existing SSN object based on an user defined file.

    -
    -

    Usage

    +
    ssn_update_path(x, path, verbose = FALSE)
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    An SSN, ssn_lm or ssn_glm object.

    -
    path
    +
    path

    Filepath to the .ssn folder associated with the SSN object.

    -
    verbose
    +
    verbose

    A logical that indicates if the new path should be printed to the console.

    -
    -

    Value

    -

    An SSN object with a new path list element.

    +
    +

    Value

    + + +

    An SSN object with a new path list element.

    -
    -

    Details

    +
    +

    Details

    At times, it may be necessary to move a .ssn directory, which is linked to an SSN object in an R workspace. If the .ssn directory is moved, the path must be updated before using the @@ -81,8 +100,8 @@

    Details

    -
    -

    Examples

    +
    +

    Examples

    ## Use mf04p SSN object provided in SSN2
     data(mf04p)
     
    @@ -92,23 +111,27 @@ 

    Examplesmf04p <- ssn_update_path(mf04p, newpath)

    -
    +
    + +
    -
    + + diff --git a/docs/reference/ssn_write.html b/docs/reference/ssn_write.html index f027a48..c749d98 100644 --- a/docs/reference/ssn_write.html +++ b/docs/reference/ssn_write.html @@ -1,84 +1,103 @@ -write an SSN object — ssn_write • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    This function writes an SSN object to a local .ssn directory

    -
    -

    Usage

    +
    ssn_write(ssn, path, overwrite = FALSE, copy_dist = FALSE, import = FALSE)
    -
    -

    Arguments

    - - -
    ssn
    +
    +

    Arguments

    +
    ssn

    An SSN object.

    -
    path
    +
    path

    filepath to the local .ssn directory to write to.

    -
    overwrite
    +
    overwrite

    If TRUE, overwrite existing files in file (if it exists). Defaults to FALSE.

    -
    copy_dist
    +
    copy_dist

    If TRUE, copy distance matrices to file (if they exist). Defaults to FALSE.

    -
    import
    +
    import

    If TRUE, import and return the SSN object after writing to file. Defaults to FALSE.

    -
    -

    Value

    -

    ssn_write creates an .ssn directory that contains the +

    +

    Value

    + + +

    ssn_write creates an .ssn directory that contains the spatial, topological, and attribute information stored in the original SSN object. Spatial datasets found in the SSN object (e.g. edges, obs, and prediction sites) are @@ -86,8 +105,8 @@

    Value

    SSN object is imported and returned.

    -
    -

    Examples

    +
    +

    Examples

    ## For examples only, copy MiddleFork04.ssn directory to R's
     # temporary directory
     copy_lsn_to_temp()
    @@ -110,23 +129,27 @@ 

    Examples), overwrite = TRUE, import = TRUE)

    -
    +
    + +
    -
    + + diff --git a/docs/reference/summary.SSN.html b/docs/reference/summary.SSN.html index ada97e9..1619d16 100644 --- a/docs/reference/summary.SSN.html +++ b/docs/reference/summary.SSN.html @@ -1,71 +1,91 @@ -Summarize an SSN object — summary.SSN • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Summarize data found in an SSN object.

    -
    -

    Usage

    -
    # S3 method for class 'SSN'
    +    
    +
    # S3 method for SSN
     summary(object, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    An SSN object.

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A list with several fitted model quantities used to create +

    +

    Value

    + + +

    A list with several fitted model quantities used to create informative summaries when printing.

    -
    -

    Details

    +
    +

    Details

    summary.SSN() creates a summary of a SSN object intended to be printed using print(). This summary contains information about the number of observed and prediction @@ -73,23 +93,27 @@

    Details

    -
    +
    + +
    -
    + + diff --git a/docs/reference/summary.SSN2.html b/docs/reference/summary.SSN2.html index 5d958e1..31ed5b4 100644 --- a/docs/reference/summary.SSN2.html +++ b/docs/reference/summary.SSN2.html @@ -1,87 +1,107 @@ -Summarize a fitted model object — summary.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Summarize a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     summary(object, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     summary(object, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A list with several fitted model quantities used to create +

    +

    Value

    + + +

    A list with several fitted model quantities used to create informative summaries when printing.

    -
    -

    Details

    +
    +

    Details

    summary.ssn() creates a summary of a fitted model object intended to be printed using print(). This summary contains useful information like the original function call, residuals, a coefficients table, a pseudo r-squared, and estimated covariance parameters.

    -
    -

    See also

    +
    +

    See also

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -122,23 +142,27 @@ 

    Examples#>

    -
    +
    + +
    -
    + + diff --git a/docs/reference/tidy.SSN2.html b/docs/reference/tidy.SSN2.html index 4bdc9d3..c352bd5 100644 --- a/docs/reference/tidy.SSN2.html +++ b/docs/reference/tidy.SSN2.html @@ -1,75 +1,93 @@ -Tidy a fitted model object — tidy.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Tidy a fitted model object into a summarized tibble.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     tidy(x, conf.int = FALSE, conf.level = 0.95, effects = "fixed", ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     tidy(x, conf.int = FALSE, conf.level = 0.95, effects = "fixed", ...)
    -
    -

    Arguments

    - - -
    x
    +
    +

    Arguments

    +
    x

    A fitted model object from ssn_lm() or ssn_glm().

    -
    conf.int
    +
    conf.int

    Logical indicating whether or not to include a confidence interval in the tidied output. The default is FALSE.

    -
    conf.level
    +
    conf.level

    The confidence level to use for the confidence interval if conf.int is TRUE. Must be strictly greater than 0 and less than 1. The default is 0.95, which corresponds to a 95 percent confidence interval.

    -
    effects
    +
    effects

    The type of effects to tidy. Available options are "fixed" (fixed effects), "tailup" (tailup covariance parameters), "taildown" (taildown covariance parameters), "euclid" (Euclidean @@ -79,21 +97,23 @@

    Arguments, and "randcov" (random effect variances). The default is "fixed".

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A tidy tibble of summary information effects.

    +
    +

    Value

    + + +

    A tidy tibble of summary information effects.

    -
    -

    See also

    + -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -115,23 +135,27 @@ 

    Examples#> 2 ELEV_DEM -0.0341 0.00438 -7.80 6.22e-15

    -
    +
    + +
    -
    + + diff --git a/docs/reference/varcomp.SSN2.html b/docs/reference/varcomp.SSN2.html index 826bc13..29a12f0 100644 --- a/docs/reference/varcomp.SSN2.html +++ b/docs/reference/varcomp.SSN2.html @@ -1,73 +1,92 @@ -Variability component comparison — varcomp.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Compare the proportion of total variability explained by the fixed effects and each variance parameter.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     varcomp(object, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     varcomp(object, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    -

    Value

    -

    A tibble that partitions the the total variability by the fixed effects +

    +

    Value

    + + +

    A tibble that partitions the the total variability by the fixed effects and each variance parameter. The proportion of variability explained by the fixed effects is the pseudo R-squared obtained by psuedoR2(). The remaining proportion is spread accordingly among each variance parameter: @@ -77,8 +96,8 @@

    Value

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -103,23 +122,27 @@ 

    Examples#> 5 nugget 0.0155

    -
    +
    + +
    -
    + + diff --git a/docs/reference/vcov.SSN2.html b/docs/reference/vcov.SSN2.html index 663f26e..07772cc 100644 --- a/docs/reference/vcov.SSN2.html +++ b/docs/reference/vcov.SSN2.html @@ -1,81 +1,101 @@ -Calculate variance-covariance matrix for a fitted model object — vcov.SSN2 • SSN2 - Skip to contents - - -
    -
    -
    +
    +
    + + + +
    +
    + -
    +

    Calculate variance-covariance matrix for a fitted model object.

    -
    -

    Usage

    -
    # S3 method for class 'ssn_lm'
    +    
    +
    # S3 method for ssn_lm
     vcov(object, ...)
     
    -# S3 method for class 'ssn_glm'
    +# S3 method for ssn_glm
     vcov(object, var_correct = TRUE, ...)
    -
    -

    Arguments

    - - -
    object
    +
    +

    Arguments

    +
    object

    A fitted model object from ssn_lm() or ssn_glm().

    -
    ...
    +
    ...

    Other arguments. Not used (needed for generic consistency).

    -
    var_correct
    +
    var_correct

    A logical indicating whether to return the corrected variance-covariance matrix for models fit using ssn_glm() (when family is different from "Gaussian"). The default is TRUE.

    -
    -

    Value

    -

    The variance-covariance matrix of coefficients obtained via coef(). +

    +

    Value

    + + +

    The variance-covariance matrix of coefficients obtained via coef(). Currently, only the variance-covariance matrix of the fixed effects is supported.

    -
    -

    Examples

    +
    +

    Examples

    # Copy the mf04p .ssn data to a local directory and read it into R
     # When modeling with your .ssn object, you will load it using the relevant
     # path to the .ssn data on your machine
    @@ -95,23 +115,27 @@ 

    Examples#> ELEV_DEM -0.03855169 1.915303e-05

    -
    +
    + +
    -
    + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 90937ed..cd06bd3 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -1,70 +1,204 @@ - -/404.html -/articles/index.html -/articles/introduction.html -/authors.html -/CONTRIBUTING.html -/index.html -/LICENSE.html -/news/index.html -/reference/AIC.SSN2.html -/reference/anova.SSN2.html -/reference/augment.SSN2.html -/reference/coef.SSN2.html -/reference/confint.SSN2.html -/reference/cooks.distance.SSN2.html -/reference/copy_lsn_to_temp.html -/reference/covmatrix.SSN2.html -/reference/create_netgeom.html -/reference/deviance.SSN2.html -/reference/fitted.SSN2.html -/reference/formula.SSN2.html -/reference/glance.SSN2.html -/reference/glances.SSN2.html -/reference/hatvalues.SSN2.html -/reference/index.html -/reference/influence.SSN2.html -/reference/labels.SSN2.html -/reference/logLik.SSN2.html -/reference/loocv.SSN2.html -/reference/mf04p.html -/reference/MiddleFork04.ssn.html -/reference/model.frame.SSN2.html -/reference/model.matrix.SSN2.html -/reference/names.SSN.html -/reference/plot.SSN2.html -/reference/plot.Torgegram.html -/reference/predict.SSN2.html -/reference/print.SSN.html -/reference/print.SSN2.html -/reference/pseudoR2.SSN2.html -/reference/reexports.html -/reference/residuals.SSN2.html -/reference/SSN2-package.html -/reference/ssn_create_distmat.html -/reference/ssn_get_data.html -/reference/ssn_get_netgeom.html -/reference/ssn_get_netgeometry.html -/reference/ssn_get_stream_distmat.html -/reference/ssn_glm.html -/reference/ssn_import.html -/reference/ssn_import_predpts.html -/reference/ssn_initial.html -/reference/ssn_lm.html -/reference/ssn_names.html -/reference/ssn_params.html -/reference/ssn_put_data.html -/reference/ssn_simulate.html -/reference/ssn_split_predpts.html -/reference/ssn_subset.html -/reference/SSN_to_SSN2.html -/reference/ssn_update_path.html -/reference/ssn_write.html -/reference/summary.SSN.html -/reference/summary.SSN2.html -/reference/tidy.SSN2.html -/reference/Torgegram.html -/reference/varcomp.SSN2.html -/reference/vcov.SSN2.html + + + + https://usepa.github.io/SSN2/404.html + + + https://usepa.github.io/SSN2/articles/index.html + + + https://usepa.github.io/SSN2/articles/introduction.html + + + https://usepa.github.io/SSN2/authors.html + + + https://usepa.github.io/SSN2/CONTRIBUTING.html + + + https://usepa.github.io/SSN2/index.html + + + https://usepa.github.io/SSN2/LICENSE.html + + + https://usepa.github.io/SSN2/news/index.html + + + https://usepa.github.io/SSN2/reference/AIC.SSN2.html + + + https://usepa.github.io/SSN2/reference/anova.SSN2.html + + + https://usepa.github.io/SSN2/reference/augment.SSN2.html + + + https://usepa.github.io/SSN2/reference/coef.SSN2.html + + + https://usepa.github.io/SSN2/reference/confint.SSN2.html + + + https://usepa.github.io/SSN2/reference/cooks.distance.SSN2.html + + + https://usepa.github.io/SSN2/reference/copy_lsn_to_temp.html + + + https://usepa.github.io/SSN2/reference/covmatrix.SSN2.html + + + https://usepa.github.io/SSN2/reference/create_netgeom.html + + + https://usepa.github.io/SSN2/reference/deviance.SSN2.html + + + https://usepa.github.io/SSN2/reference/fitted.SSN2.html + + + https://usepa.github.io/SSN2/reference/formula.SSN2.html + + + https://usepa.github.io/SSN2/reference/glance.SSN2.html + + + https://usepa.github.io/SSN2/reference/glances.SSN2.html + + + https://usepa.github.io/SSN2/reference/hatvalues.SSN2.html + + + https://usepa.github.io/SSN2/reference/index.html + + + https://usepa.github.io/SSN2/reference/influence.SSN2.html + + + https://usepa.github.io/SSN2/reference/labels.SSN2.html + + + https://usepa.github.io/SSN2/reference/logLik.SSN2.html + + + https://usepa.github.io/SSN2/reference/loocv.SSN2.html + + + https://usepa.github.io/SSN2/reference/mf04p.html + + + https://usepa.github.io/SSN2/reference/MiddleFork04.ssn.html + + + https://usepa.github.io/SSN2/reference/model.frame.SSN2.html + + + https://usepa.github.io/SSN2/reference/model.matrix.SSN2.html + + + https://usepa.github.io/SSN2/reference/names.SSN.html + + + https://usepa.github.io/SSN2/reference/plot.SSN2.html + + + https://usepa.github.io/SSN2/reference/plot.Torgegram.html + + + https://usepa.github.io/SSN2/reference/predict.SSN2.html + + + https://usepa.github.io/SSN2/reference/print.SSN.html + + + https://usepa.github.io/SSN2/reference/print.SSN2.html + + + https://usepa.github.io/SSN2/reference/pseudoR2.SSN2.html + + + https://usepa.github.io/SSN2/reference/reexports.html + + + https://usepa.github.io/SSN2/reference/residuals.SSN2.html + + + https://usepa.github.io/SSN2/reference/SSN2-package.html + + + https://usepa.github.io/SSN2/reference/ssn_create_distmat.html + + + https://usepa.github.io/SSN2/reference/ssn_get_data.html + + + https://usepa.github.io/SSN2/reference/ssn_get_netgeom.html + + + https://usepa.github.io/SSN2/reference/ssn_get_netgeometry.html + + + https://usepa.github.io/SSN2/reference/ssn_get_stream_distmat.html + + + https://usepa.github.io/SSN2/reference/ssn_glm.html + + + https://usepa.github.io/SSN2/reference/ssn_import.html + + + https://usepa.github.io/SSN2/reference/ssn_import_predpts.html + + + https://usepa.github.io/SSN2/reference/ssn_initial.html + + + https://usepa.github.io/SSN2/reference/ssn_lm.html + + + https://usepa.github.io/SSN2/reference/ssn_names.html + + + https://usepa.github.io/SSN2/reference/ssn_params.html + + + https://usepa.github.io/SSN2/reference/ssn_put_data.html + + + https://usepa.github.io/SSN2/reference/ssn_simulate.html + + + https://usepa.github.io/SSN2/reference/ssn_split_predpts.html + + + https://usepa.github.io/SSN2/reference/ssn_subset.html + + + https://usepa.github.io/SSN2/reference/SSN_to_SSN2.html + + + https://usepa.github.io/SSN2/reference/ssn_update_path.html + + + https://usepa.github.io/SSN2/reference/ssn_write.html + + + https://usepa.github.io/SSN2/reference/summary.SSN.html + + + https://usepa.github.io/SSN2/reference/summary.SSN2.html + + + https://usepa.github.io/SSN2/reference/tidy.SSN2.html + + + https://usepa.github.io/SSN2/reference/Torgegram.html + + + https://usepa.github.io/SSN2/reference/varcomp.SSN2.html + + + https://usepa.github.io/SSN2/reference/vcov.SSN2.html + -