R2C {conformal} | R Documentation |
Convert objects to a complex vector
R2C(ww) listxy2C(x) matrix2C(x)
ww |
A real vector representing alternating real/imaginary pairs or a complex vector |
x |
A list having two components or a matrix having two columns representing the real and imaginary parts of a complex vector |
a complex vector
Nick Ellis, nick.ellis@csiro.au
x <- 1:10 y <- 10:1 mat <- cbind(x,y) lis <- list(x,y) xy <- as.vector(t(mat)) z1 <- R2C(xy) z2 <- listxy2C(lis) z3 <- matrix2C(mat) all(z1==z2) all(z1==z3)