caret_setResponse: Set response variable

caret::setResponseR Documentation

Set response variable

Description

Set response variable to be used in model-fitting functions of package caret. The response variable must be set upon any model training using a hsdar-object in caret.

Usage

## S4 method for signature '.CaretHyperspectral,character'
setResponse(x, response)

Arguments

x

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

response

Character. Name of response variable (from the SI).

Value

The updated object.

Author(s)

Lukas Lehnert

See Also

showCaretParameters, setPredictor

Examples

## Not run: 
data(spectral_data)

## Set response variable (Chlorophyll content)
spectral_data <- setResponse(spectral_data, "chlorophyll")

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