Convenience function for making a named list from a vector or list of names and a vector or list of values

nlist(names, values)

Arguments

names

a vector or list of the names

values

a vector or list of the values

Value

a named list

Examples

n <- LETTERS[1:3]
val <- c("cat", "dog", "ferret")
nlist(n, val)
#> $A
#> [1] "cat"
#> 
#> $B
#> [1] "dog"
#> 
#> $C
#> [1] "ferret"
#> 

nlist(list("A", "B"), 1:2)
#> $A
#> [1] 1
#> 
#> $B
#> [1] 2
#>