Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

caret_setPredictor

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: Speclib, Nri, Specfeat.

predictor

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

Value

The updated object.

Author(s)

Lukas Lehnert

See Also

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

Manage, Analyse and Simulate Hyperspectral Data

v1.0.3
GPL
Authors
Lukas W. Lehnert [cre, aut] (<https://orcid.org/0000-0002-5229-2282>), Hanna Meyer [ctb], Joerg Bendix [ctb]
Initial release
2020-08-04

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.