I have created a nested list:
my_list <- list(A = "first item",
B = "second item")
and given this list the name 'list 1':
vector_names <- c("list 1", "list 2")
assign(vector_names[[1]], my_list)
However, now I want to use the object list 1 inside of a nested list, to obtain:
final_list <- list("1st_list" = list(A = "first item",
B = "second item"))
How can I refer to the list without copying it again? I tried:
final_list <- list("1st_list" = 'list 1')
but this doesn't return the Object list 1, it return a character vector 'list 1'.