Even an empty list will always be named.
Arguments
- names
[character]
Names of elements.
- init
[valid R expression]
If given all list elements are initialized to this, otherwise
NULL is used.
Examples
namedList(c("a", "b"))
#> $a
#> NULL
#>
#> $b
#> NULL
#>
namedList(c("a", "b"), init = 1)
#> $a
#> [1] 1
#>
#> $b
#> [1] 1
#>