Set dimensions of an Object
set_dim(x, dim)
set_dimnames(x, value)
an R object, for example a matrix, array or data frame.
integer vector, see also base::dim()
For the default method, either NULL
or
a numeric vector, which is coerced to integer (by truncation).
x <- 1:12
set_dim(x, c(3, 4))
#> [,1] [,2] [,3] [,4]
#> [1,] 1 4 7 10
#> [2,] 2 5 8 11
#> [3,] 3 6 9 12