6.1 Arithmetic operators

R is a programming language with a focus on statistics. While it can be used for very complex tasks, it can also be used as a simple calculator, as previously demonstrated.

The following arithmetic operators can be used for these tasks:

Operator Function
+ addition
- subtraction
/ division
* multiplication
^ or ** exponential

In the R terminal, you can type the following:

10-2

And hit Enter for R to interpret the command, and output the result.

Then try the following:

3*5

or:

(4*12)/5