View source: R/B001_integerSet.R
integerSet | R Documentation |
An S4 class to describe a set of integers using conditions. Here are some examples;
Any integer from 5 to 10 or from 50 to 100
Any integer under 7
Any integer in the vector c(12,11,17,14)
It can also represent the union of such sets. For example any integer that meets any one of the above conditions.
The function integerCheck checks whether a given integer belongs to a given integerSet.
integerSet(...) ## S4 method for signature 'integerSet' initialize( .Object, integers = numeric(), from = numeric(), to = numeric(), over = numeric(), under = numeric() ) integerSet(...) frames(...) integerCheck(inputNum, inputSet)
integers, from, to, over, under |
parameters for the constructor new("integerSet") go directly into the relevant slots |
inputNum |
a single to number to be compared against inputSet |
inputSet |
an integerSet object |
integerCheck(number,set) will return TRUE if
number belongs to set@integers
number>set@over
number<set@under
sum(number>set@from)>sum(number>set@to)
If none of these conditions are met, integerCheck will return FALSE. The only exception to all of this is if set@integers contains -Inf. In this case, integerCheck will always FALSE.
integers
A vector of integers.
from
stuff
to
see from
over
lala
under
Like over, but for the < operator
#An integer set autoPass=new("integerSet") integerCheck(4,autoPass) autoFail=new("integerSet",integers=-Inf) integerCheck(4,autoFail)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.