Learn R Programming

matricks (version 0.8.2)

with_same_dims: Create new matrix copying dimensions from the existing one

Description

Create new matrix copying dimensions from the existing one

Usage

with_same_dims(mat, data)

Arguments

mat

a matrix with desired dimensions

data

sigle numeric value or numeric vector

Value

a matrix

Examples

Run this code
# 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