This help topic is for R version 0.60. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/base/html/Arithmetic.html
Arithmetic {base}R Documentation

Arithmetic Operators

Usage

x + y
x - y
x * y
x / y
x ^ y
x %% y
x %/% y

Value

These binary operators perform arithmetic on vector objects. They return numeric vectors containing the result of the element by element operations. The elements of shorter vectors are recycled as necessary. The operators are + for addition, - for subtraction * for multiplication, / for division and ^ for exponentiation. %% 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.

See Also

Math for miscellaneous and Special for special mathematical functions.

Examples

x <- -1:12
x + 1
2 * x + 3
x %% 2
x %/% 5

[Package base version 0.60 ]