# is.one.sided: Determine if an object is one- or two-sided. Test whether a... In formula.tools: Programmatic Utilities for Manipulating Formulas, Expressions, Calls, Assignments and Other R Objects

## 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

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37``` ```is.one.sided(x, ...) ## S4 method for signature 'formula' is.one.sided(x, ...) ## S4 method for signature 'call' is.one.sided(x, ...) ## S4 method for signature 'expression' is.one.sided(x, ...) ## S4 method for signature 'list' is.one.sided(x, ...) ## S4 method for signature 'ANY' is.one.sided(x, ...) is.two.sided(x, ...) ## S4 method for signature 'formula' is.two.sided(x, ...) ## S4 method for signature 'call' is.two.sided(x, ...) ## S4 method for signature 'expression' is.two.sided(x, ...) ## S4 method for signature 'list' is.two.sided(x, ...) ## S4 method for signature 'ANY' is.two.sided(x, ...) ```

## Arguments

 `x` object to test for one-sidedness. `...` arguments passed to called functions

## 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`.

## Value

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

## Note

Methods for the "`<-`" class exist and are not included in the usage documentation because CRAN does not support S4 documentation for this class.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10``` ```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) ```

formula.tools documentation built on May 2, 2019, 1:45 p.m.