Learn R Programming

formula.tools (version 1.7.1)

is.one.sided: Determine if an object is one- or two-sided. Test whether a object (typically formula, call or expression) is one- (e.g. ~x) or two-sided (e.g. x~y).

Description

Determine if an object is one- or two-sided.

Test whether a object (typically formula, call or expression) is one- (e.g. ~x) or two-sided (e.g. x~y).

Usage

is.one.sided(x, ...)

# S4 method for formula is.one.sided(x, ...)

# S4 method for call is.one.sided(x, ...)

# S4 method for expression is.one.sided(x, ...)

# S4 method for list is.one.sided(x, ...)

# S4 method for ANY is.one.sided(x, ...)

is.two.sided(x, ...)

# S4 method for formula is.two.sided(x, ...)

# S4 method for call is.two.sided(x, ...)

# S4 method for expression is.two.sided(x, ...)

# S4 method for list is.two.sided(x, ...)

# S4 method for ANY is.two.sided(x, ...)

Arguments

x

object to test for one-sidedness.

...

arguments passed to called functions

Value

logical; whether x is an object is one-sided or two-sided formula.

Details

These functions detect whether the formula is single- (unary) or double- sided. They work on formulas, expression, calls, assignments, etc.

is.single.sided and is.unary are alias for is.single.sided. is.double.sided and is.binary are aliases for is.two.sided.

Examples

Run this code
# NOT RUN {
form <- y ~ x 

is.one.sided(form)
# is.single.sided(form)
# is.unary(form) 

is.two.sided(form)
# is.double.sided(form)
# is.binary(form)
                
# }

Run the code above in your browser using DataLab