with_same_dims: Create new matrix copying dimensions from the existing one

Description Usage Arguments Value Examples

View source: R/matrix.R

Description

Create new matrix copying dimensions from the existing one

Usage

1

Arguments

mat

a matrix with desired dimensions

data

sigle numeric value or numeric vector

Value

a matrix

Examples

1
2
3
4
x <- matrix(7, 3, 6)
x
with_same_dims(x, 0)
with_same_dims(x, c(1, 2))

matricks documentation built on March 26, 2020, 6:22 p.m.