Learn R Programming

BMisc (version 1.4.8)

rhs_vars: Right-hand Side Variables

Description

Take a formula and return a vector of the variables on the right hand side

Usage

rhs_vars(formula)

Value

vector of variable names

Arguments

formula

a formula

Examples

Run this code
ff <- yvar ~ x1 + x2
rhs_vars(ff)

ff <- y ~ x1 + I(x1^2)
rhs_vars(ff)

Run the code above in your browser using DataLab