Description Usage Arguments Details See Also
There is no formal class definition for S3. Simply add 'Infix' or 'Print' to the class attribute and it inherits the methods. It is the same as Binary-class
or Show-class
just for S3. This is inteded to be used with retList
.
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 38 39 40 41 | ## S3 method for class 'Print'
print(x, ...)
## S3 method for class 'Infix'
e1 + e2
## S3 method for class 'Infix'
e1 - e2
## S3 method for class 'Infix'
e1 / e2
## S3 method for class 'Infix'
e1 %% e2
## S3 method for class 'Infix'
e1 ^ e2
## S3 method for class 'Infix'
e1 < e2
## S3 method for class 'Infix'
e1 > e2
## S3 method for class 'Infix'
e1 == e2
## S3 method for class 'Infix'
e1 >= e2
## S3 method for class 'Infix'
e1 <= e2
## S3 method for class 'Infix'
e1 & e2
## S3 method for class 'Infix'
!x
## S3 method for class 'Infix'
as.environment(x)
|
x |
an object |
... |
arguments passed to the local print method. |
e1 |
lhs operand |
e2 |
rhs operand |
The lhs is coerced with as.environment
and in that environment the binary operators must be found and named as .<binaryOperator>
(see the example for retList
). This is implemented for the following operators: +, -, *, /, %%, ^, <, >, ==, >=, <=, &
. Also part of the operators you can implement with Infix is !
, although it is unary.
Binary-class, retList
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.