Basic arithmetic and use of scientific notation in R
- The R Console can be used as a basic calculator: For example you can compute the standard 15% tip on a $16.99 bill by typing
0.15 * 16.99
and hitting Enter.
- You can use parentheses to enforce a specific order of operations.
- The caret symbol
^
can be used for powers. for example 2 ^ 4
would produce the fourth power of 2, i.e. 16.
- Very large or very small numbers can be entered using scientific notation. For example, we can enter the number of 3.2 millions as
3.2e6
and the number of 0.000016
as 1.6e-5
.
- Depending on the number of digits of the number in question, R may choose to display it via either decimal or scientific notation.