> x <- 1:4, y <- 6:9
> x + y
[1] 7 9 11 13
> x > 2
[1] FALSE FALSE TRUE TRUE
Vectorized Matrix Operations
> x <- matrix(1:4, 2, 2); y <- matrix(rep(10, 4), 2, 2)
rep creates a 2x2 matrix of 10s
True matrix multiplication is performed using %*%:
> x %*% y
\t[ ,1]\t[ ,2]
[1, ]\t40\t40
[2, ]\t60\t60