signp                package:cwhmath                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, 1, 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:

       signp(x)

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

       x: a numeric vector

_A_u_t_h_o_r(_s):

     Christian W. Hoffmann, christian.hoffmann@wsl.ch, 
      <URL: http://www.wsl.ch/staff/christian.hoffmann>

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

     'sign'

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

     signp(-2:3)# -1 -1 1 1 1 1
     (m <- matrix(rnorm(9),3,3))
     m %*% diag(signp(diag(m)))

