Description Usage Arguments Value See Also Examples
Inspired by the dot syntax from Julia's broadcast
, execute mapply() with a convenient shortand.
1 2 |
f |
Function. |
x |
First argument to vectorize over. |
... |
a list of additional arguments to FUN. See |
simplify |
Boolean, same as SIMPLIFY in |
List (if simplify = FALSE) or array (if simplify = TRUE).
https://github.com/robertschnitman/afp, mapply
,
broadcast
from Julia: https://docs.julialang.org/en/v0.6.1/manual/arrays/#Broadcasting-1
1 2 3 4 5 6 7 8 9 10 | set.seed(1)
a <- matrix(1:9, 3, 3)
b <- 20:22
c <- matrix(rnorm(9), 3,)
bcast(`/`, a, b, simplify = TRUE) # matrix.
bcast(`/`, a, b, c, simplify = TRUE) # If a warning occurs, output may be list.
# Alternate syntax
.(`/`, a, b, simplify = TRUE) # matrix.
.(`/`, a, b, c, simplify = TRUE) # If a warning occurs, output may be list.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.