library("broadcast")
<- c(10, 2,2)
x.dim <- prod(x.dim)
x.len
<- function(n) sample(list(letters, month.abb, 1:10), n, TRUE)
gen
<- array(gen(10), x.dim)
x <- array(gen(10), c(10,1,1))
y
bc.list(
x, y,c(length(x) == length(y), typeof(x) == typeof(y))
\(x, y)
)## , , 1
##
## [,1] [,2]
## [1,] logical,2 logical,2
## [2,] logical,2 logical,2
## [3,] logical,2 logical,2
## [4,] logical,2 logical,2
## [5,] logical,2 logical,2
## [6,] logical,2 logical,2
## [7,] logical,2 logical,2
## [8,] logical,2 logical,2
## [9,] logical,2 logical,2
## [10,] logical,2 logical,2
##
## , , 2
##
## [,1] [,2]
## [1,] logical,2 logical,2
## [2,] logical,2 logical,2
## [3,] logical,2 logical,2
## [4,] logical,2 logical,2
## [5,] logical,2 logical,2
## [6,] logical,2 logical,2
## [7,] logical,2 logical,2
## [8,] logical,2 logical,2
## [9,] logical,2 logical,2
## [10,] logical,2 logical,2
bc.list
Broadcasted Operations for Recursive Arrays
Description
The bc.list()
function performs broadcasted operations on 2 Recursive arrays.
Usage
bc.list(x, y, f, ...)
## S4 method for signature 'ANY'
bc.list(x, y, f)
Arguments
x , y
|
conformable Recursive arrays (i.e. arrays of type list ).
|
f
|
a function that takes in exactly 2 arguments, and returns a result that can be stored in a single element of a list. |
…
|
further arguments passed to or from methods. |
Value
A recursive array.