home *** CD-ROM | disk | FTP | other *** search
/ Big Green CD 8 / BGCD_8_Dev.iso / NEXTSTEP / UNIX / Educational / R-0.49-MI / R-0.49-I / help / base / complex < prev    next >
Encoding:
Text File  |  1997-04-23  |  1.1 KB  |  38 lines

  1.     
  2.     _C_o_m_p_l_e_x _V_e_c_t_o_r_s
  3.     
  4.          complex(n=0, real=numeric(), imag=numeric())
  5.          as.complex(z)
  6.          is.complex(z)
  7.     
  8.          Re(z)
  9.          Im(z)
  10.          Mod(z)
  11.          Arg(z)
  12.          Conj(z)
  13.     
  14.     _D_e_s_c_r_i_p_t_i_o_n:
  15.     
  16.          These are basic functions which support complex arith-
  17.          metic in R.  Complex vectors can be created with com-
  18.          plex.  The vector can be specified either by giving its
  19.          length, or its real and imaginary parts (or both).
  20.     
  21.          Note that is.complex and is.numeric are never both
  22.          TRUE.
  23.     
  24.          The functions Re, Im, Mod, Arg and Conj have their
  25.          usual interpretation as returning the real part, ima-
  26.          ginary part, modulus, argument and complex conjugate
  27.          for complex values.  In addition, the elementary tri-
  28.          gonometric, logarithmic and exponential functions are
  29.          available for complex values.
  30.     
  31.     _E_x_a_m_p_l_e_s:
  32.     
  33.          # create a complex normal vector
  34.          z <- complex(real=rnorm(100), imag=rnorm(100))
  35.          # or also (less efficiently):
  36.          z2 <- 1:2 + 1i*(8:9)
  37.     
  38.