Learn R Programming

autopls (version 1.3)

predict.autopls: Prediction using a fitted autopls model

Description

Applies a model from a autopls object to a vector, matrix or to a stack or brick from package raster.

Usage

"predict"(object, dat, ...)

Arguments

object
object of class autopls
dat
vector, matrix, dataframe or imagery (the latter as stack or brick from package raster.
...
logical. Arguments to be passed to method

Value

A new vector matrix or image depending on the type of newdata

Details

Elements, columns or layers must have the same number and order as the input predictors for autopls. The predictors resulting from autopls are selected silently. In case of large image files the function is based on tile processing.

See Also

autopls

Examples

Run this code
  ## load predictor and response data to the current environment
  data (murnau.X)
  data (murnau.Y)
  
  ## call autopls with the standard options
  model<-autopls (murnau.Y ~ murnau.X)

  ## new data
  new <- murnau.X + 500 

  ## prediction
  predict (model, new)

Run the code above in your browser using DataLab