Convenience functions that create an array full of identical entries.

mZeros(...)

mOnes(...)

mTRUE(...)

mFALSE(...)

mNULL(...)

Arguments

...

Numbers or numeric vectors, passed to c() and then used as dim argument in a call to array().

Value

The result of array(XXX, c(...)), where XXX is 0, 1, TRUE, FALSE, or list(), respectively.

Examples

mZeros(2, 3)
#>      [,1] [,2] [,3]
#> [1,]    0    0    0
#> [2,]    0    0    0

mOnes(c(1, 2, 3))
#> , , 1
#> 
#>      [,1] [,2]
#> [1,]    1    1
#> 
#> , , 2
#> 
#>      [,1] [,2]
#> [1,]    1    1
#> 
#> , , 3
#> 
#>      [,1] [,2]
#> [1,]    1    1
#> 

mTRUE(c(1, 3), 2)
#> , , 1
#> 
#>      [,1] [,2] [,3]
#> [1,] TRUE TRUE TRUE
#> 
#> , , 2
#> 
#>      [,1] [,2] [,3]
#> [1,] TRUE TRUE TRUE
#> 

mFALSE(5)
#> [1] FALSE FALSE FALSE FALSE FALSE