6.1 Arithmetic operators

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

The following arithmetic operators can be used for these tasks:

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

In the R terminal, as you have seen before, you can type the following:

10-2

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

Then try the following:

3*5

or:

(4*12)/5