combination_function {tern}R Documentation

Class for CombinationFunction

Description

[Stable]

CombinationFunction is an S4 class which extends standard functions. These are special functions that can be combined and negated with the logical operators.

Usage

## S4 method for signature 'CombinationFunction,CombinationFunction'
e1 & e2

## S4 method for signature 'CombinationFunction,CombinationFunction'
e1 | e2

## S4 method for signature 'CombinationFunction'
!x

Arguments

e1

(CombinationFunction)
left hand side of logical operator.

e2

(CombinationFunction)
right hand side of logical operator.

x

(CombinationFunction)
the function which should be negated.

Value

A logical value indicating whether the left hand side of the equation equals the right hand side.

Functions

Examples

higher <- function(a) {
  force(a)
  CombinationFunction(
    function(x) {
      x > a
    }
  )
}

lower <- function(b) {
  force(b)
  CombinationFunction(
    function(x) {
      x < b
    }
  )
}

c1 <- higher(5)
c2 <- lower(10)
c3 <- higher(5) & lower(10)
c3(7)


[Package tern version 0.9.4 Index]