home *** CD-ROM | disk | FTP | other *** search
-
- _C_o_m_p_l_e_x _V_e_c_t_o_r_s
-
- complex(n=0, real=numeric(), imag=numeric())
- as.complex(z)
- is.complex(z)
-
- Re(z)
- Im(z)
- Mod(z)
- Arg(z)
- Conj(z)
-
- _D_e_s_c_r_i_p_t_i_o_n:
-
- These are basic functions which support complex arith-
- metic in R. Complex vectors can be created with com-
- plex. The vector can be specified either by giving its
- length, or its real and imaginary parts (or both).
-
- Note that is.complex and is.numeric are never both
- TRUE.
-
- The functions Re, Im, Mod, Arg and Conj have their
- usual interpretation as returning the real part, ima-
- ginary part, modulus, argument and complex conjugate
- for complex values. In addition, the elementary tri-
- gonometric, logarithmic and exponential functions are
- available for complex values.
-
- _E_x_a_m_p_l_e_s:
-
- # create a complex normal vector
- z <- complex(real=rnorm(100), imag=rnorm(100))
- # or also (less efficiently):
- z2 <- 1:2 + 1i*(8:9)
-
-