Learn R Programming

lavaSearch2 (version 2.0.3)

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", ...)

Value

See argument format.

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")

Examples

Run this code

if (FALSE) {

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")
}

Run the code above in your browser using DataLab