count.mod.vars {mmodely} | R Documentation |
Count the predictor variables in a model
Description
This function takes a model string and counts the number of predictor variables.
Usage
count.mod.vars(model)
Arguments
model |
model specified as a string in the form "y ~ x1 + x2 ..." |
Value
an integer specifying the count of predictor variables
Examples
count <- count.mod.vars(model=formula('y ~ x1 + x2'))
if(count == 2) { print('sane'); }else{ print('insane')}
[Package mmodely version 0.2.5 Index]