powered by
Create new matrix copying dimensions from the existing one
with_same_dims(mat, data)
a matrix with desired dimensions
sigle numeric value or numeric vector
a matrix
# NOT RUN { x <- matrix(7, 3, 6) x with_same_dims(x, 0) with_same_dims(x, c(1, 2)) # }
Run the code above in your browser using DataLab