Learn R Programming

SSN (version 1.1.7)

putSSNdata.frame: putSSNdata.frame

Description

Replacet the data.frame in an Object of Class SpatialStreamNetwork

Usage

putSSNdata.frame(DataFrame, x, Name = "Obs")

Arguments

DataFrame
data.frame to be placed into the SpatialStreamNetwork-class object
x
an object of class SpatialStreamNetwork, influenceSSN, glmssn, or glmssn.predict
Name
the internal name of the data set in the object x. For observed values, this will always be "Obs", the default.

Value

Returns an object of the same class as x.

Details

The internal Name for observed data in objects of class SpatialStreamNetwork is "Obs" and it is the default. If another Name is specified, it must represent a prediction data set in the SpatialStreamNetwork-class, influenceSSN-class, glmssn-class, or "glmssn.predict" object. For SpatialStreamNetwork objects, these names are obtained using the call ssn@predpoints@ID. For all other object classes, the names are obtained using the call object$ssn.object@predpoints@ID. See examples for additional details.

Note that, the DataFrame must be of the same dimensions as the original data.frame in the object x.

See Also

getSSNdata.frame, SpatialStreamNetwork-class, influenceSSN-class, glmssn-class

Examples

Run this code

library(SSN)
mf04 <- importSSN(system.file("lsndata/MiddleFork04.ssn", 
	package = "SSN"), o.write = TRUE)

# Take out the data.frame, make a change and put it back
obs.df <- getSSNdata.frame(mf04)
obs.df$Year_cat <- as.factor(obs.df$SampleYear)
mf04 <- putSSNdata.frame(obs.df, mf04)

Run the code above in your browser using DataLab