powered by
Figure out how many "sides" a formula has See also SimonO101's answer at http://stackoverflow.com/a/16376939/636656
sides(x, ...) # S3 method for default sides (x, ...) # S3 method for formula sides (x, ...)
# S3 method for default sides (x, ...)
# S3 method for formula sides (x, ...)
The object to calculate the sidedness of
Other items to pass along
An integer of the number of sides
# NOT RUN { test <- list( ~ a + b, a ~ b + c, b + c ~ a, ~ a ~ b, a ~ b ~ c, a~b+c|d~c~d~e~f~g ) sapply(test,sides) # }
Run the code above in your browser using DataLab