Learn R Programming

lavaSearch2 (version 1.4)

selectResponse: Response Variable of a Formula

Description

Return the response variable contained in the formula.

Usage

selectResponse(object, ...)

# S3 method for formula selectResponse(object, format = "call", ...)

Arguments

object

a formula

...

[internal] Only used by the generic method.

format

[character] should an object of type call be returned (format = "call"), or the names of the variables (format = "vars")

Value

See argument format.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
selectResponse <- lavaSearch2:::selectResponse
selectResponse.formula <- lavaSearch2:::selectResponse.formula

selectResponse(Y1~X1+X2)
selectResponse(Y1~X1+X2, format = "vars")
selectResponse(Surv(event,time)~X1+X2, format = "vars")

selectResponse(Y1~X1+Y1)
selectResponse(Y1+Y2~X1+Y1, format = "vars")

selectResponse(~X1+X2)
selectResponse(~X1+X2, format = "vars")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab