Not sure what you mean by grids. reprex maybe?
Do you want by row or by column?
V1 <- seq(1,10,1)
V2 <- seq(11,20,1)
V3 <- seq(21,30,1)
m_by_row <- # for OP to find
m_by_col <- # for OP to find
m_by_row
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
#> V1 1 2 3 4 5 6 7 8 9 10
#> V2 11 12 13 14 15 16 17 18 19 20
#> V3 21 22 23 24 25 26 27 28 29 30
m_by_col
#> V1 V2 V3
#> [1,] 1 11 21
#> [2,] 2 12 22
#> [3,] 3 13 23
#> [4,] 4 14 24
#> [5,] 5 15 25
#> [6,] 6 16 26
#> [7,] 7 17 27
#> [8,] 8 18 28
#> [9,] 9 19 29
#> [10,] 10 20 30
Created on 2019-12-28 by the reprex package (v0.3.0)