caret_setPredictor: Set predictor variable(s)

Description Usage Arguments Value Author(s) See Also Examples

Description

Set predictor variable(s) to be used in model-fitting functions of package caret. This function can be used to define additional predictor variables stored in the SI of a Speclib- or Nri-object. If the passed object is of class Nri, By default, all Nri-indices (if the passed object is of class Nri) or all bands (if the passed object is of class Speclib) are used as predictors.

Usage

1
2
## S4 method for signature '.CaretHyperspectral,character'
setPredictor(x, predictor)

Arguments

x

Object of one of the following classes: \Sexpr[echo=TRUE,results=rd]{ paste(hsdar:::.getCaretCompatibleClasses(), collapse = ", ") }.

predictor

Character vector. Name of additional predictor variable(s) (from the SI).

Value

The updated object.

Author(s)

Lukas Lehnert

See Also

showCaretParameters, setResponse

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
data(spectral_data)

## Set "season" as additional predictor variable from the SI
spectral_data <- setPredictor(spectral_data, "season")

## Show caret related parameters stored in the Speclib
showCaretParameters(spectral_data)

## End(Not run)

hsdar documentation built on Nov. 17, 2017, 4:35 a.m.