I am interested in creating a list of objects in which list elements are automatically named by the name of the input objects. I have two approaches below, but is there a way to convert this to a function for a single step solution for any number of inputs? These approaches can be tedious for many objects.

```
x <- 1
y <- "A"
# approach 1 ----
z <- list(x = x, y = y)
z
#> $x
#> [1] 1
#>
#> $y
#> [1] "A"
# approach 2 ----
# step 1 - create list
z <- list(x, y)
z
#> [[1]]
#> [1] 1
#>
#> [[2]]
#> [1] "A"
# step 2 - add names to list
z <- setNames(z, c("x", "y"))
z
#> $x
#> [1] 1
#>
#> $y
#> [1] "A"
```

^{Created on 2021-12-07 by the reprex package (v2.0.1)}