

sign {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 corre-
     sponding elements of `x' (the sign of a real number is
     1, 0, or -1 if the number is positive, zero, or nega-
     tive, 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

