ssn_write {SSN2} | R Documentation |
write an SSN object
Description
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 |
An |
path |
filepath to the local .ssn directory to write to. |
overwrite |
If |
copy_dist |
If |
import |
If |
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
saved in GeoPackage format. When import = TRUE
, the
SSN
object is imported and returned.
Examples
## For examples only, copy MiddleFork04.ssn directory to R's
# temporary directory
copy_lsn_to_temp()
## Import SSN object with prediction sites
mf04p <- ssn_import(paste0(tempdir(), "/MiddleFork04.ssn"),
predpts = "pred1km",
overwrite = TRUE
)
## Write SSN to new .ssn directory
ssn_write(mf04p,
path = paste0(tempdir(), "/tempSSN.ssn"),
overwrite = TRUE
)
## Write SSN to .ssn directory and return SSN object
tempSSN <- ssn_write(mf04p, path = paste0(
tempdir(),
"/tempSSN.ssn"
), overwrite = TRUE, import = TRUE)
[Package SSN2 version 0.2.0 Index]