powered by
Compute the elementwise sign of an array. Depending on the input the following is returned:
1: Positive input
1
0: Zero input
0
-1: Negative input
-1
NA: NA input
NA
rray_sign(x)
A vector, matrix, array or rray.
An array the same shape as x, but with numeric values indicating the sign of the values in x.
x
Other math functions: remainder, rray_abs, rray_clip, rray_maximum, rray_multiply_add
remainder
rray_abs
rray_clip
rray_maximum
rray_multiply_add
# NOT RUN { rray_sign(-5) x <- rray(c(5, NA, -5), c(3, 2)) rray_sign(x) # }
Run the code above in your browser using DataLab