list_ones.Rd
Create a list with vectors of ones from a numeric vector
list_ones(x)
a numeric vector
A list of vectors with ones
# let's say you have a numeric vector like this
num_vec = c(2, 3, 1, 4)
# get indices in vector format
list_ones(num_vec)
#> [[1]]
#> [1] 1 1
#>
#> [[2]]
#> [1] 1 1 1
#>
#> [[3]]
#> [1] 1
#>
#> [[4]]
#> [1] 1 1 1 1
#>