Create an indexed list from the columns of a dummy (or semi-dummy) matrix

dummy_to_list(Dummy)

Arguments

Dummy

matrix (dummy by columns)

Value

A list of indexed vectors

Author

Gaston Sanchez

Examples

# let's say you have a list like this
some_list = list(1:3, 1:2, 1:4)

# first create a dummy matrix based on some_list
some_dummy = list_to_dummy(some_list)

# now apply 'dummy_to_list'
dummy_to_list(some_dummy)
#> [[1]]
#> [1] 1 1 1
#> 
#> [[2]]
#> [1] 2 2
#> 
#> [[3]]
#> [1] 3 3 3 3
#> 

# a semi-dummy matrix
semi_dummy = some_dummy
semi_dummy[semi_dummy != 0] = rnorm(listsize(some_list))
dummy_to_list(semi_dummy)
#> [[1]]
#> [1] 1 1 1
#> 
#> [[2]]
#> [1] 2 2
#> 
#> [[3]]
#> [1] 3 3 3 3
#>