Description Usage Arguments Details Value Examples
Perform a mathematical operation on two formula
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | op_formula(op, e1, e2)
multiply_formula(e1, e2)
divide_formula(e1, e2)
add_formula(e1, e2)
subtract_formula(e1, e2)
## S3 method for class 'formula'
Ops(e1, e2)
## S3 method for class 'formula'
Math(x, ...)
|
op |
The operation to perform either as a name or something that can be coerced into a name. |
e1, e2, x |
The formulae to operate on |
... |
Ignored. |
The method for combination depends if the two formula are one- or two-sided.
If both formula are one-sided, the right hand side (RHS) of both are added together with additional parentheses added, if parentheses appear to be needed. If both formula are two-sided, the left hand side (LHS) and RHS are separately added. If one formula is one-sided and the other is two-sided, the LHS is selected from the two-sided formula and the RHS follows rules as though two one-sided formula were added.
multiply_formula
Multiply two formula (identical to (a~b) * (c~d)
divide_formula
Divide two formula (identical to (a~b) / (c~d)
add_formula
Add two formula (identical to (a~b) + (c~d)
subtract_formula
Multiply two formula (identical to (a~b) - (c~d)
Ops.formula
Supports generic binary operators and a couple of
unary operators (see ?Ops).
Math.formula
Supports generic unary operators (see ?Math).
e1
and e2
combined by the operation with the
environment from e1
. See Details.
1 2 3 4 5 6 7 8 9 | op_formula("+", a~b, c~d)
op_formula("+", a~b, ~d)
op_formula("+", ~b, c~d)
op_formula("+", ~b, ~d)
op_formula("-", a~b)
op_formula("-", -a~b) # Dumb, but accurate
op_formula("-", -a~b, c~-d) # Dumb, but accurate
log(a~b)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.