response | R Documentation |
Extract the response variable from an object.
response(object, ...)
## S3 method for class 'MLModelFit'
response(object, newdata = NULL, ...)
## S3 method for class 'ModelFrame'
response(object, newdata = NULL, ...)
## S3 method for class 'ModelSpecification'
response(object, newdata = NULL, ...)
## S3 method for class 'recipe'
response(object, newdata = NULL, ...)
object |
model fit, input, or specification containing predictor and response variables. |
... |
arguments passed to other methods. |
newdata |
data frame from which to extract the
response variable values if given; otherwise, |
## Survival response example
library(survival)
mf <- ModelFrame(Surv(time, status) ~ ., data = veteran)
response(mf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.