sign                  package:base                  R Documentation

_S_i_g_n _F_u_n_c_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     `sign' returns a vector with the signs of the corresponding
     elements of `x' (the sign of a real number is 1, 0, or -1 if the
     number is positive, zero, or negative, respectively).

     Note that `sign' does not operate on complex vectors.

_U_s_a_g_e:

     sign(x)

_A_r_g_u_m_e_n_t_s:

       x: a numeric vector

_S_e_e _A_l_s_o:

     `abs'

_E_x_a_m_p_l_e_s:

     sign(pi) # == 1
     sign(-2:3)# -1 -1 0 1 1 1

