Skip to contents

stm_ones() creates a matrix of ones with the specified number of rows and columns. It uses the stm_constant() function to fill the matrix with ones.

Usage

stm_ones(nrows, ncols = nrows)

Arguments

nrows

The number of rows in the matrix.

ncols

The number of columns in the matrix. Defaults to nrows.

Value

A matrix filled with ones, with dimensions specified by nrows and ncols.

Examples

stm_ones(nrows = 4)
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    1    1    1
#> [2,]    1    1    1    1
#> [3,]    1    1    1    1
#> [4,]    1    1    1    1
stm_ones(nrows = 3, ncols = 3)
#>      [,1] [,2] [,3]
#> [1,]    1    1    1
#> [2,]    1    1    1
#> [3,]    1    1    1
stm_ones(nrows = 2, ncols = 4)
#>      [,1] [,2] [,3] [,4]
#> [1,]    1    1    1    1
#> [2,]    1    1    1    1