Description Usage Arguments Value Examples
View source: R/vector_calculations.R
Dot product, or scalar product, is calculated by taking the sum of each element of a vector multiplied with the corresponding element in another vector:
DP(x,y) = Σ( x(i) * y(i) )
This function sums up the scalar multiplication of each element in the vectors, and returns the results.
1 | dot_product(x, y)
|
x |
A vector. |
y |
A vector. |
The dot product of x
and y
.
1 2 | dot_product(c(1,2,3,4), c(5,6,7,8))
dot_product(W["loue",], W["hate",])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.