Rev 48 | Rev 1188 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
\name{complex}\title{Complex Vectors}\usage{complex(n = 0, real = numeric(), imaginary = numeric())as.complex(z)is.complex(z)Re(z)Im(z)Mod(z)Arg(z)Conj(z)}\alias{complex}\alias{as.complex}\alias{is.complex}\alias{Re}\alias{Im}\alias{Mod}\alias{Arg}\alias{Conj}\description{These are basic functions which support complex arithmetic in R.Complex vectors can be created with \code{complex}. The vector can bespecified either by giving its length, or its real and imaginary parts(or both).Note that \code{is.complex} and \code{is.numeric} are never both\code{TRUE}.The functions \code{Re}, \code{Im}, \code{Mod}, \code{Arg} and\code{Conj} have their usual interpretation as returning the realpart, imaginary part, modulus, argument and complex conjugate forcomplex values. In addition, the elementary trigonometric,logarithmic and exponential functions are available for complexvalues.}\examples{## create a complex normal vectorz <- complex(real = rnorm(100), imag = rnorm(100))## or also (less efficiently):z2 <- 1:2 + 1i*(8:9)}\keyword{complex}