Displaying 1 result from an estimated 1 matches for "listvar2".
Did you mean:
listvars
2011 Aug 17
3
Obtaining variable's names from a list of variables
Say I have a list of variables,
listVar <- list(age,sex)
I am looking for a way to either
1- create a vector c("age","sex") from it, or
2- get the names one by one in a for loop such as these
a) for (i in 1:length(listVar)) rownames(result)[i] <- ???
b) for(i in listVar) print (variable's name)
Any help much appreciated.
[[alternative HTML version