getResponse | R Documentation |
Return response variable name from a fitted model
getResponse(formula)
formula |
or fitted model object |
Works for lm, glm, gam and gls model objects - maybe others as well.
a vector of response variable names as character strings
getResponse(formula(y ~ x)) # single response variable
getResponse(formula(y1 + y2 ~ x)) # multiple response variables
x <- runif(10)
y <- 2*x + rnorm(10)
fit <- lm(y ~ x)
getResponse(fit) # usin a fitted lm model
fit <- glm(y ~ x)
getResponse(fit) # usin a fitted glm model
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.