inner | R Documentation |
Calculate the custom matrix inner product z
of two matrices, x
and y
,
where z[i,j] = FUN(x[,i], y[,j])
.
inner(x, y, FUN = "crossprod", ...)
x, y |
|
FUN |
|
... |
additional parameters for |
matrix
, inner product of x
and y
.
x <- matrix(1:6, 2, 3)
y <- matrix(7:12, 2, 3)
## The default is equivalent to `crossprod(x, y)`
inner(x, y)
## We can compute the pair-wise Euclidean distance of columns.
EuclideanDistance = function(x, y) crossprod(x, y)^2
inner(x, y, EuclideanDistance)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.