Simple, arithmetic expressions operate elementwise on vectors and matrices. For instance, suppose we want to multiply the vector xx with a sequence from 1 to 6, defined by 1:6. Doing this in R will produce
> xx [1] 1 2 3 1 2 3 > 1:6 [1] 1 2 3 4 5 6 > xx*1:6 [1] 1 4 9 4 10 18so that R is literally producing the new vector by xx[i]*1:6[i] for i=
> mm%*%t(mm)
[,1] [,2] [,3]
[1,] 66 78 90
[2,] 78 93 108
[3,] 90 108 126
will yield mm multiplied by the transpose of mm.