Arithmetic operations
arith.RdArithmetic operations including low-level helper functions
Usage
disord_inverse(a)
disord_mod_disord(a,b)
disord_mod_numeric(a,b)
disord_negative(a)
disord_plus_disord(a,b)
disord_plus_numeric(a,b)
disord_power_disord(a,b)
disord_power_numeric(a,b)
numeric_power_disord(a,b)
disord_prod_disord(a,b)
disord_prod_numeric(a,b)
disord_arith_unary(e1,e2)
disord_arith_disord(e1,e2)
disord_arith_numeric(e1,e2)
numeric_arith_disord(e1,e2)Details
Basic low-level arithmetic operations, intended to be called from S4 dispatch.
These functions return a disord object or a regular vector as
appropriate. Consistency is required. The hash is set to be that of
the disord object if appropriate.
Methods
- Arith
signature(e1="disord", e2="disord"): Dispatched todisord_arith_disord()- Arith
signature(e1="disord", e2="numeric"): Dispatched todisord_arith_numeric()- Arith
signature(e1="numeric", e2="disord"): Dispatched tonumeric_arith_disord()- Arith
signature(e1="disord", e2="missing"): Dispatched todisord_arith_unary()
Examples
a <- rdis()
a
#> A disord object with hash 25e5446f6b1d27e45fc29230d14c76aa6bbba046 and elements
#> [1] 5 6 4 6 9 5 5 8 2
#> (in some order)
a + 2*a
#> A disord object with hash 25e5446f6b1d27e45fc29230d14c76aa6bbba046 and elements
#> [1] 15 18 12 18 27 15 15 24 6
#> (in some order)
a > 5
#> A disord object with hash 25e5446f6b1d27e45fc29230d14c76aa6bbba046 and elements
#> [1] FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE FALSE
#> (in some order)
a[a > 5] <- a[a > 5] + 100
a
#> A disord object with hash 25e5446f6b1d27e45fc29230d14c76aa6bbba046 and elements
#> [1] 5 106 4 106 109 5 5 108 2
#> (in some order)