Learn R Programming

taRifx (version 1.0.6.2)

sides: Figure out how many "sides" a formula has See also SimonO101's answer at http://stackoverflow.com/a/16376939/636656

Description

Figure out how many "sides" a formula has See also SimonO101's answer at http://stackoverflow.com/a/16376939/636656

Usage

sides(x, ...)

# S3 method for default sides (x, ...)

# S3 method for formula sides (x, ...)

Arguments

x

The object to calculate the sidedness of

Other items to pass along

Value

An integer of the number of sides

Examples

Run this code
# 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