Vectorised mathematical functions

\[\textbf{x} \quad of \quad length \quad n \quad (x_1, x_2, ..., x_n)\]

abs() is vectorized:

abs(c(2, 0, -1, -3, NA_real_))
## [1]  2  0  1  3 NA

Instead of defined to act on a single value (“scalar”) it is applied on each element:

\[ |\textbf{x}| = (|x_1|, |x_2|, ..., |x_n|) \]

It is the same for round, floor, etc but also log and exp (keep it mind changing the base of the log is an argument, default is base = exp(1))