transformSSNVars: A function to conveniently transform multiple variables...

Description Usage Arguments Details Value

View source: R/transformSSNVars.R

Description

The process of modifying the data.frame objects in the observed and predicted sites of a SpatialStreamNetwork can be complicated. This function simplifies this process.

Usage

1
2
transformSSNVars(ssn, new.ssn.path, obs.vars, preds.vars, func,
  write.out = FALSE, ...)

Arguments

ssn

An object of class SpatialStreamNetwork

new.ssn.path

The directory in which a new .ssn directory should be written out. Ignored if write.out = FALSE.

obs.vars

A character vector containing the names of the columns in the observed sites point.data slot which should be transformed. If this is a named vector, then new columns with those names will be added. Otherwise, the old columns will be overwritten.

preds.vars

A character vector containing the names of the columns in the prediction sites point.data slot which should be transformed. If this is a named vector, then new columns with those names will be added. Otherwise, the old columns will be overwritten.

func

The function which should be used to transform the columns.

write.out

A logical indicating whether the .ssn folder in ssn@path should be updated.

...

Additional arguments to func.

Details

Note, if write.out = TRUE then the SSN will be re-imported before returning. Note also that write.out = TRUE will cause the data inside the .ssn directory to be overwritten.

Value

An object of class SpatialStreamNetwork


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