| bc.cplx | R Documentation | 
The bc.cplx() function performs broadcasted complex numeric operations on pairs of arrays. 
Note that bc.cplx() uses more strict NA checks than base 'R': 
If for an element of either x or y, either the real or imaginary part is NA or NaN,
than the result of the operation for that element is necessarily NA. 
 
bc.cplx(x, y, op, ...)
## S4 method for signature 'ANY'
bc.cplx(x, y, op)
x, y | 
 conformable atomic arrays of type   | 
op | 
 a single string, giving the operator.   | 
... | 
 further arguments passed to or from methods.   | 
For arithmetic operators: 
A complex array as a result of the broadcasted arithmetic operation. 
For relational operators: 
A logical array as a result of the broadcasted relational comparison. 
broadcast_operators 
x.dim <- c(4:2)
x.len <- prod(x.dim)
gen <- function() sample(c(rnorm(10), NA, NA, NaN, NaN, Inf, Inf, -Inf, -Inf))
x <- array(gen() + gen() * -1i, x.dim)
y <- array(gen() + gen() * -1i, c(4,1,1))
bc.cplx(x, y, "==")
bc.cplx(x, y, "!=")
bc.cplx(x, y, "+")
bc.cplx(array(gen() + gen() * -1i), array(gen() + gen() * -1i), "==")
bc.cplx(array(gen() + gen() * -1i), array(gen() + gen() * -1i), "!=")
x <- gen() + gen() * -1i
y <- gen() + gen() * -1i
out <- bc.cplx(array(x), array(y), "*")
cbind(x, y, x*y, out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.