Arithmetic and Storing Values
Ben Dickins
There are three types of expression in R
1. Numbers: 1, 2, 0.2, -5, etc
2. Strings: alphabets or anything that is input by “” into R
3. Logical: TRUE
/FALSE
TRUE
/FALSE
x + y
sum
x - y
subtract
x * y
multiply
x / y
divide
x ^ y
power
Do it yourself:
<-
, see the example below:Note: In most contexts the =
operator can be used as an alternative.