When constructing a list()
, particularly large ones, I would like to find a way to get R to guess the name of the elements being passed to the list, based on the name of the element itself.
For example, to construct a list with the following data:
dog <- c(1,2,3)
cat <- c(3,2,1)
With names I currently have to write:
list(dog = dog, cat = cat)
Is there a way to simply write:
list(dog, cat)
where the names of the element are automatically guessed based on the element name?