c(mapply(append, test1, test2))
[1] 1 6 2 7 3 8 4 9 5 10
如果需要矩阵输出,请使用
as.matrix(c(mapply(append, test1, test2)), ncol = 1)
[,1]
[1,] 1
[2,] 6
[3,] 2
[4,] 7
[5,] 3
[6,] 8
[7,] 4
[8,] 9
[9,] 5
[10,] 10