Assuming:
aa = c('A','B','C')
bb = c('D','E','F')
list1 = list(aa,bb)
vect1 = c(aa,bb)
Is there a way to extract the variable names as strings ('aa', 'bb') from either list1 or vect1? Is this information being stored in lists and vectors? If not, what would be the appropriate format?
Thanks in advance!
For the situation what you have done the answer is no. But if you are ready to do some changes in your code then you can easily get it,
list1 <- list( aa = aa, bb = bb)
Now you can easily access the string version of names of variables from which list
is formed,
names(list1)