Is there a function in R
to get the module of a negative number or a vector of numbers?
example:
v <- c(1,-2,3,-4)
module(v)
#> [1] 1 2 3 4
Is there a function in R
to get the module of a negative number or a vector of numbers?
example:
v <- c(1,-2,3,-4)
module(v)
#> [1] 1 2 3 4
Use the function abs
(value abs oluto):
> v <- c(1,-2,3,-4)
> abs(v)
[1] 1 2 3 4