updatePath: Update Path Slot in SpatialStreamNetwork Object

Description Usage Arguments Details Author(s) Examples

View source: R/updatePath.r

Description

Updates the path slot in an existing SpatialStreamNetwork object based on a user-defined filepath.

Usage

1
 updatePath(ssn, filepath) 

Arguments

ssn

a SpatialStreamNetwork object

filepath

path name to the .ssn folder, in string format including quotes. Also include the .ssn folder in the path name

Details

At times, it may be necessary to move a .ssn directory, which is linked to a SpatialStreamNetwork object in an R workspace. If the .ssn directory is moved, the path slot must be updated before using the glmssn function. The updatePath function serves this purpose.

Author(s)

Erin E. Peterson support@SpatialStreamNetworks.com

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
library(SSN)

#for examples, copy MiddleFork04.ssn directory to R's temporary directory
copyLSN2temp()
# NOT RUN
# Create a SpatialStreamNetork object that also contains prediction sites
#mf04p <- importSSN(paste0(tempdir(),'/MiddleFork04.ssn'), 
#  predpts = "pred1km", o.write = TRUE)
#use mf04p SpatialStreamNetwork object, already created
data(mf04p)
#for examples only, make sure mf04p has the correct path
#if you use importSSN(), path will be correct
mf04p <- updatePath(mf04p, paste0(tempdir(),'/MiddleFork04.ssn'))


## UPDATE PATH FOR glmssn object
## get some model fits stored as data objects
data(modelFits)
## NOT RUN
## Fit a model to binary data
## binSp <- glmssn(MaxOver20 ~ ELEV_DEM + SLOPE, mf04p,
##   CorModels = c("Mariah.tailup", "Spherical.taildown"),
##   family = "binomial", addfunccol = "afvArea")
##for examples only, make sure binSp has the correct path
##if you use importSSN(), path will be correct
binSp$ssn.object <- updatePath(binSp$ssn.object, 
	paste0(tempdir(),'/MiddleFork04.ssn'))
summary(binSp)

SSN documentation built on March 13, 2020, 1:49 a.m.