home *** CD-ROM | disk | FTP | other *** search
-
- _A_r_i_t_h_m_e_t_i_c _O_p_e_r_a_t_o_r_s
-
- x + y
- x - y
- x * y
- x / y
- x ^ y
- x %% y
- x %/% y
-
- _V_a_l_u_e:
-
- These binary operators perform arithmetic on vector
- objects. They return numeric vectors containing the
- result of the element by element operations. The ele-
- ments of shorter vectors are recycled as necessary.
- The operators are + for addition, - for subtraction *
- for multiplication, / for division and ^ for exponen-
- tiation. %% indicates x mod y and %/% indicates
- integer division.
-
- Objects such as arrays or time-series can be operated
- on this way provided they are conformable.
-
- _S_e_e _A_l_s_o:
-
- Math.
-
- _E_x_a_m_p_l_e_s:
-
- x <- -1:12
- x + 1
- 2 * x + 3
- x %% 2
- x %/% 5
-
-