Description Usage Arguments Details Value Examples
These functions provide Lisp/Scheme-friendly aliases for and thin wrappers around some numeric infix operators from base R.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | expt(e1, e2)
quotient(e1, e2)
remainder(e1, e2)
modulo(e1, e2)
is.number(x)
is.even(x)
is.odd(x)
is.zero(x)
is.positive(x)
is.negative(x)
|
e1 |
For expt, quotient, remainder and modulo, the left-hand argument to the underlying infix operator. |
e2 |
For expt, quotient, remainder and modulo, the right-hand argument to the underlying infix operator. |
x |
An R object on which to check a predicate. |
The expt, quotient, remainder and modulo functions are aliases for the following base operators:
expt
is ^
quotient
is %/%
remainder
is %%
modulo
is also %%
The is.number function is an alias for the is.numeric function from base; the other is.* functions are simple predicates that do what their names suggest.
For the is.* functions, TRUE or FALSE; for expt, quotient, remainder and modulo, the result of the operation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | expt(4, 5) == 4^5 #=> 1024
quotient(10, 3) == 10 %/% 3 #=> 3
remainder(10, 3) == 10 %% 3 #=> 1
modulo(10, 3) == 10 %% 3 #=> 1
is.number(3) && !is.number("foo")
is.even(22) && !is.even(23)
is.odd(23) && !is.odd(22)
is.zero(0) && !is.zero(1)
is.positive(234) && !is.positive(-34)
is.negative(-34) && !is.negative(234)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.