Learn R Programming

SSNbler (version 1.1.0)

ssn_check: Check an SSN object

Description

Check an SSN (spatial stream network) object to ensure that it contains valid spatial, topological, and attribute information needed to fit spatial statistical stream network models using the 'SSN2' package.

Usage

ssn_check(ssn.object, check_obs = TRUE, afv_col = NULL, verbose = TRUE)

Value

Boolean indicating whether the SSN object is valid. If verbose = TRUE, additional messages are printed to the console describing potential issues with the SSN object.

Arguments

ssn.object

An SSN object created using ssn_assemble or imported using ssn_import.

check_obs

A logical indicating whether the observations should be checked. Default = TRUE.

afv_col

Character vector containing names of columns containing additive function values. The Default = NULL.

verbose

Logical TRUE/FALSE indicating whether details describing the checks are printed to the console. If verbose = FALSE, a logical TRUE/FALSE is returned indicating whether the SSN object passed all of the checks. Default = TRUE.

Examples

Run this code
## Create local temporary copy of MiddleFork04.ssn found in
## the SSN2 package. Only necessary for this example.
SSN2::copy_lsn_to_temp()

# Import the SSN object with prediction points, pred1km
mf04 <- SSN2::ssn_import(
  paste0(tempdir(), "/MiddleFork04.ssn"),
  predpts = c("pred1km"),
  overwrite = TRUE
)

# Check the SSN object, including the additive function column,
# afvArea
ssn_check(mf04, afv_col = "afvArea")

Run the code above in your browser using DataLab