kronecker(X, Y, FUN = "*", make.dimnames = FALSE, ...) X %x% Y
X, Y | arrays with any number of dimensions. A vector is converted to a 1-dimensional array. |
FUN | a function (or the name of a function) of at least 2 arguments that maps vectors of the elements of the X and Y arrays to an output vector of the same length. By default, this is the multiplication function giving the usual Kronecker product. |
make.dimnames | a logical value. If TRUE, specifies that the dimnames of the output should be constructed from the dimnames of the inputs. By default, FALSE. |
... | other arguments to pass to the the function FUN. |
kronecker(matrix(1:6,3,2), diag(2)) matrix(1:6,3,2) %x% diag(2) # the same # still the same kronecker(matrix(1:6,3,2), diag(2), function(x, y) x * y)kronecker( array(1:6,c(2,1,3),list(paste0("R",1:2),paste0("C",1),paste0("Strata",1:3))), matrix(c(100,200), nrow=1, ncol=2, dimnames=list(NULL,c("1H","2H"))), FUN=`+`, make.dimnames=TRUE)