| bc.d | R Documentation |
The bc.d() method
performs broadcasted decimal numeric operations on 2 numeric or logical arrays.
bc.d(x, y, op, ...)
## S4 method for signature 'ANY'
bc.d(x, y, op, tol = sqrt(.Machine$double.eps))
x, y |
conformable vectors/arrays of type numeric or logical. |
op |
a single string, giving the operator. |
... |
further arguments passed to or from methods. |
tol |
a single number between 0 and 0.1, giving the machine tolerance to use for the relational operators. |
For the "+", "-" operators:
An array of type double or integer (depending on the input types)
as a result of the broadcasted operation.
Integer overflow results in an error
(base 'R', in contrast, gives an warning and returns NA at integer overflow).
For the "*", "/", "^" operators:
An array of type double as a result of the broadcasted operation.
For relational operators:
A logical array as a result of the broadcasted decimal relational comparison.
For pmin/pmax:
An array of type double or integer (depending on the input types)
as a result of the broadcasted operation.
broadcast_operators
x.dim <- c(4:2)
x.len <- prod(x.dim)
x.data <- sample(c(NA, 1.1:1000.1), x.len, TRUE)
x <- array(x.data, x.dim)
y <- array(1:50, c(4,1,1))
bc.d(x, y, "+")
bc.d(x, y, "-")
bc.d(x, y, "*")
bc.d(x, y, "/")
bc.d(x, y, "^")
bc.d(x, y, "==")
bc.d(x, y, "!=")
bc.d(x, y, "<")
bc.d(x, y, ">")
bc.d(x, y, "<=")
bc.d(x, y, ">=")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.