| bc.cplx | R Documentation |
The bc.cplx() method
performs broadcasted complex numeric operations on pairs of arrays.
bc.cplx(x, y, op, ...)
## S4 method for signature 'ANY'
bc.cplx(x, y, op)
x, y |
conformable vectors/arrays of type |
op |
a single string, giving the operator. |
... |
further arguments passed to or from methods. |
For the * and / operators, bc.cplx() uses more strict NA checks than base 'R':
If for an iteration,
re(x), im(x), re(y), and/or im(y) contains NA,
than the result for that iteration is necessarily NA_complex_.
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(20), NA, NaN, 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 <- array(gen() + gen() * -1i)
y <- array(gen() + gen() * -1i)
bcr(x) <- bcr(y) <- TRUE
out <- x * y
bind_array(list(x = x, y = y, `x*y` = x*y, out = out), 2L)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.