subsetSSN | R Documentation |
The subsetSSN
function returns an SpatialStreamnetwork object that
has been subset based on a logical expression.
subsetSSN(ssn, filename = "", subset, clip = FALSE)
ssn |
a SpatialStreamNetwork-class object |
filename |
the file path to the new .ssn folder, in string format. When writing, include the .ssn folder in the path |
subset |
logical expression indicating which elements or rows to keep: missing values are taken as false |
clip |
default = FALSE. If TRUE, create a subset of the edges and prediction sites, based on the same logical expression used to subset the observed sites, and export the subset data to the new .ssn folder |
subsetSSN
returns an object of class SpatialStreamNetwork
.
It also creates and stores an SQLite database, binaryID.db, within the new .ssn
directory.
Erin E. Peterson support@SpatialStreamNetworks.com
SpatialStreamNetwork-class
library(SSN)
#for examples, copy MiddleFork04.ssn directory to R's temporary directory
copyLSN2temp()
# Create a SpatialStreamNetork object
ssn <- importSSN(paste0(tempdir(),'/MiddleFork04.ssn'), o.write = TRUE)
ssn.sub1 <- subsetSSN(ssn, filename =
paste(tempdir(),"/subset1.ssn", sep = ""), subset = Summer_mn > 13)
# another example
#ssn.sub2 <- subsetSSN(ssn, filename =
# paste(tempdir(),"/subset2.ssn", sep = ""), subset = netID == 1, clip = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.