Make an array of ones

ones(...)

Arguments

...

A sequence of dimensions separated by commas

Value

An integer array of ones

Examples

ones(5)
#> [1] 1 1 1 1 1
ones(5, 1)
#> [,1] #> [1,] 1 #> [2,] 1 #> [3,] 1 #> [4,] 1 #> [5,] 1
ones(1, 5)
#> [,1] [,2] [,3] [,4] [,5] #> [1,] 1 1 1 1 1
ones(2, 3)
#> [,1] [,2] [,3] #> [1,] 1 1 1 #> [2,] 1 1 1
ones(2, 3, 2)
#> , , 1 #> #> [,1] [,2] [,3] #> [1,] 1 1 1 #> [2,] 1 1 1 #> #> , , 2 #> #> [,1] [,2] [,3] #> [1,] 1 1 1 #> [2,] 1 1 1 #>
str(ones(5))
#> int [1:5(1d)] 1 1 1 1 1