count.mod.vars: Count the predictor variables in a model

View source: R/models.R

count.mod.varsR 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')} 


mmodely documentation built on May 31, 2023, 6:47 p.m.