Vectorised mathematical functions
xoflengthn(x1,x2,...,xn)
abs()
is vectorized:
## [1] 2 0 1 3 NA
Instead of defined to act on a single value (“scalar”) it is applied on each element:
|x|=(|x1|,|x2|,...,|xn|)
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)
)