fn builtin_sign(
args: &[RValue],
_: &[(String, RValue)],
) -> Result<RValue, RError>Expand description
Sign of each element (-1, 0, or 1).
R’s sign() returns 0 for zero inputs (unlike Rust’s f64::signum which returns 1.0). For integer inputs, returns an integer vector; for double inputs, returns a double vector.
@param x numeric vector @return numeric vector of signs