Author(s)

See Also

Examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

##Create two vectors of equal length
v1 <-rnorm(10)
v2 <-rnorm(10)##compute the inner product between the vectorsdotProd(v1,v2)##orsum(v1*v2)##compute the square 2-norm of v1norm2(v1)##ordotProd(v1,v1)##orsum(v1*v1)##If the vectors are of unequal length the longer vector##gets truncated (with a warning). dotProd(v1,c(v2,2))