Section 8 R Object Assignment
8.1 R Object Assignment
Operator | Explanation | Example |
---|---|---|
+ | Addition | x + y |
- | Subtraction | x - y |
* | Multiplication | x * y |
/ | Division | x / y |
%% | Modulus | x %% y |
%/% | Integer division | x %/% y |
^ | Exponentiation | x ^ y |
() | Parenthesis (precedence rule) | (x + y) * z |
- | Negate | -x |
8.2 R Object Example
<- 10
x print(x) # explicit printing
# auto-printing
x
+ 3
x / 3
x -x
<- x + 3
y
y
+ y
x - y
x * y
x / y x
8.3 More Examples
<- 10
x <- x + 3
y
^2
y%/% x
y %% x
y
<- 2
z
5*x + 3*y + 7*z
5*x^2 + 3*x*y + 7*z^3 + 8*sqrt(y)
x; y; z%/% z / y * x x