[1] 0.15
[1] 44.66667
[1] 1
Here are some common operators:
| Operation | Written | In R |
|---|---|---|
| Addition | \(1+1\) | 1+1 |
| Subtraction | \(2-1\) | 2-1 |
| Multiplication | \(3\times 2\) or \(3\cdot 2\) | 3*2 |
| Division | \(3 / 2\) or \(\dfrac{3}{2}\) | 3/2 |
| Exponential | \(4^2\) | 4^2 |
| Square root | \(\sqrt{4}\) or \(4^{1/2}\) | 4^(1/2) or sqrt(4) |
These operators are interpreted as questions
R will return a true or false answer, depending on if it meets the criteria
| Operation | In R |
|---|---|
| Less than | 1<1 |
| Greater than | 1>1 |
| Less than or equal to | 1<=1 |
| Greater than or equal to | 1>=1 |
| Equal to | 1==1 |
| Not equal to | 1!=1 |
Basics