SSN_to_SSN2 {SSN2}R Documentation

Convert object from SpatialStreamNetwork class to SSN class

Description

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, edge_additive = NULL, site_additive = NULL)

Arguments

object

A SpatialStreamNetwork object

edge_additive

A character vector of additive function value column names found in edges. Default is NULL. See Details for more information.

site_additive

A character vector of additive function value column names found in the observed sites and prediction sites. See Details for more information. Default is NULL.

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 objects stored in saved workspaces to the S3 SSN class object used in the SSN2 package. Note that ssn_import is used to create an S3 SSN object from data stored locally in a .ssn directory.

Additive function values are used to generate spatial weights for the tail-up covariance function used in ssn_glm. The range of additive function values are restricted to 0 \le AFV \le 1. In the SSN2 package, columns containing additive function values are stored as text, rather than numeric format. This prevents values less than 1 with more than 10 digits from being truncated when writing/reading shapefiles (and their .dbf tables). The columns containing additive function values are specified using the edge_additive and site_additive arguments and converted to character format in the SSN class object returned. The arguments edge_additive and site_additive accept a single column name in character format, or a vector containing multiple column names. Note that, column names for additive function values on the edges, sites, and prediction sites may differ. If a column specified in edge_additive or site_additive is not present, the function will return a warning, rather than an error. Columns containing additive function values can also be converted to text manually using the formatC function, which provides the flexibility needed to store the values with their full precision.

Value

An S3 SSN class object, with additive function value columns converted to text format.


[Package SSN2 version 0.1.1 Index]