Description Usage Arguments Details Value Examples
View source: R/splitSSNSites.R
Primarily intended to be used with the optimiseSSNDesign
function, this function takes an SSN with temporal replicates across some number of sites and splits the sites into separate shapefiles based on the levels of the replication variable. This makes it easier to deal with the SSN in a statistically consistent way when performing sequential design over the network.
1 2 | splitSSNSites(big.ssn, new.ssn.path, replication.variable, preds = TRUE,
preferred.wd = getwd())
|
big.ssn |
The SpatialStreamNetwork object which contains the temporally replicated site data. |
new.ssn.path |
A file path for a new SSN object. |
replication.variable |
A string which indicates which variable in the |
preds |
A logical which indicates whether the prediction sites should be dealt with in the same way. This predpoints object should contain the same levels of the replication variable as the obspoints slot. |
preferred.wd |
A directory where the shapefiles should be written. |
This function is wrapped by optimiseSSNDesign
. The optimiseSSNDesign
function should be sufficient for most adaptive design problems where this is required. However, for more bespoke applications, it may be worthwhile to use this function on its own instead.
This function returns an object of class SpatialStreamNetwork. This SpatialStreamNetwork will contain the sites with the lowest value of the replication variable.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
s <- createSSN(10, binomialDesign(100, 2), path = tempPath("r.ssn"), importToR = T)
# Split SSN sites into two shapefiles, one for each year
split <- splitSSNSites(s, tempPath("split.ssn"), "Time", FALSE, tempdir())
# Join the year 2 shapefile back to the year 1 shapefile in the SSN
spliced <- spliceSSNSites(split, tempPath("spliced.ssn"), paste0(tempdir(), "/sites2.shp"))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.