Learn R Programming

SSN (version 1.1.7)

predict.glmssn: Calculate Predictions for Prediction Sites

Description

The predict.glmssn function calculates prediction values for prediction sites based on the results stored within an object of class glmssn

Usage

"predict"(object, predpointsID, ...)

Arguments

object
the glmssn object
predpointsID
the prediction points ID
...
other arguments passed to predict

Value

The overall structure is the same as an object of class glmssn, except the prediction points data.frame in the SpatialStreamNetwork object (list-item 2) is appended by the following columns:
     # The prediction value for each prediction site
    .predSE # The standard error of the prediction value
  
Details of this object structure can be found using the names command.

Details

predict.glmssn is a generic function that has been modified for glmssn objects. Two new columns are added to the prediction points data.frame (point.data) within the existing glmssn object. The first column contains prediction values and has the same name as the response variable. The second column .predSE contains the standard errors for the predictions.

See Also

glmssn

Examples

Run this code
library(SSN)
data(modelFits)
#Update the fitSp path, will vary for each users installation
fitSp$ssn.object <- updatePath(fitSp$ssn.object, 
  system.file("lsndata/MiddleFork04.ssn", package = "SSN"))
names(fitSp)
names(fitSp$ssn.object)

ssnpred <- predict(fitSp, predpointsID = "pred1km")
names(ssnpred)
names(ssnpred$ssn.object) ## Note additional predicted columns in pred1km
plot(ssnpred)


Run the code above in your browser using DataLab