editForm: Edit a formula

Description Usage Arguments Value Examples

Description

Easy way to add or subtract predictor variables to a formula

Usage

1
editForm(form, add = NULL, sub = NULL)

Arguments

form

formula, the formula you will be editing

add

character vector, predictor variables to add to formula

sub

character vector, predictor variables to subtract (remove) from formula

Value

formula, edited formula object

Examples

1
2
3
4
form <- as.formula('mpg~cyl+hp+drat+qsec')
editForm(form, add=c('wt', 'gear', 'carb'))
editForm(form, sub=c('cyl', 'hp', 'qsec', 'variableNotInFormula'))
editForm(form, sub=c('cyl', 'hp', 'qsec'), add=c('wt'))

brooksandrew/Rsenal documentation built on May 13, 2019, 7:50 a.m.