splitSSNSites: Split the temporally replicated point data for a...

Description Usage Arguments Details Value Examples

View source: R/splitSSNSites.R

Description

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.

Usage

1
2
splitSSNSites(big.ssn, new.ssn.path, replication.variable, preds = TRUE,
  preferred.wd = getwd())

Arguments

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 big.ssn@obspoints@SSNPoints[[1]]@point.data should be used to split big.ssn into separate shapefiles.

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.

Details

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.

Value

This function returns an object of class SpatialStreamNetwork. This SpatialStreamNetwork will contain the sites with the lowest value of the replication variable.

Examples

 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)

apear9/SSNdesign documentation built on Feb. 19, 2020, 4:29 a.m.