Learn R Programming

latexSymb (version 1.0.0)

+: Arithmetic

Description

There are natural interpretations for doing arithmetic operations on objects of class latexSymb. Namely, their output is another object of that class, constructed using the repr of the arguments and the corresponding symbol for the operation. These functions implement the elementary ones.

Usage

a + b
a - b
a / b
a * b
a ^ b
under(a,b)

Value

An object of class latex_symb whose repr is:

  • For + and -, the concatenation of a's repr, the corresponding arithmetic symbol, and b's repr.

  • For *, the concatenation of the repr, with a space between.

  • For /, a and b's repr inside \frac{}{}.

  • For ^, a's repr, a caret and b's repr in braces.

  • For under, a's repr, an underscore and b's repr in braces

Arguments

a

An object that can be passed to as.character

b

An object that can be passed to as.character

Examples

Run this code
a <- lsymb("\\alpha")
b <- lsymb("\\beta")
a+b
a-b
a*b
a/b
a^b
under(a,b)

Run the code above in your browser using DataLab