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

response-methods

Extract Response Variable


Description

Extract the response variable from an object.

Usage

response(object, ...)

## S3 method for class 'MLModelFit'
response(object, newdata = NULL, ...)

## S3 method for class 'ModelFrame'
response(object, newdata = NULL, ...)

## S3 method for class 'recipe'
response(object, newdata = NULL, ...)

Arguments

object

model fit result, ModelFrame, or recipe.

...

arguments passed to other methods.

newdata

data frame from which to extract the response variable values if given; otherwise, object is used.

Examples

## Survival response example
library(survival)

mf <- ModelFrame(Surv(time, status) ~ ., data = veteran)
response(mf)

MachineShop

Machine Learning Models and Tools

v2.8.0
GPL-3
Authors
Brian J Smith [aut, cre]
Initial release
2021-04-16

We don't support your browser anymore

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