How can I get a function which takes a matrix and a vector as input and does the following
v<-c(1,2,4)
[,1] [,2]
[1,] 1 4
[2,] 2 5
[3,] 3 6
The outout shall be:
[,1] [,2]
[1,] 1 4
[2,] 2 5
[3,] 2 5
[4,] 3 6
[5,] 3 6
[6,] 3 6
[7,] 3 6