caret_setPredictor: Set predictor variable(s)

caret::setPredictorR Documentation

Set predictor variable(s)

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

## 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

## 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 March 18, 2022, 6:35 p.m.