This is similar to @bgoldst's answer, a little different. It adds a string of zeros and then reorders the strings. We start with the nrow(m) + 1length vector nrow(m) + length(x)(where xis the location vector), and then replace the indices that are not in x, with their corresponding source indices.
nr <- nrow(m)
rbind(m, 0)[replace(rep(nr + 1L, nr + length(x)), -x, seq_len(nr)), ]
# [,1] [,2] [,3]
# [1,] 1 2 3
# [2,] 0 0 0
# [3,] 4 5 6
# [4,] 7 8 9
# [5,] 0 0 0
# [6,] 0 0 0
# [7,] 6 9 2
# [8,] 3 6 1
# [9,] 2 2 7
Data:
m <- structure(c(1L, 4L, 7L, 6L, 3L, 2L, 2L, 5L, 8L, 9L, 6L, 2L, 3L,
6L, 9L, 2L, 1L, 7L), .Dim = c(6L, 3L))
x <- c(2, 5, 6)