I would like to add each element in one vector with each element in another vector as follows, but avoid the for loops. Is there a simple method?
What you are looking for is outer(), as in:
outer()
> outer(a, b, "+") [,1] [,2] [1,] 4 5 [2,] 5 6 [3,] 6 7 [4,] 7 8 [5,] 8 9 [6,] 9 10 [7,] 10 11 [8,] 11 12 [9,] 12 13 [10,] 13 14