How can I generate a list of all the variables that have been assigned in an R language session?
Asked
Active
Viewed 80 times
-2
-
Since this doesn't involve actual computations, it is off-topic here. It is likely better suited for the R forums or StackOverflow. – Godric Seer Dec 05 '13 at 19:40
-
2I'm more inclined to keep it here for now, if it gets answered, because I believe it would fall under the header of "Software packages or languages used in computational science". If we get enough questions on R language syntax, then we can talk about migrating & clarifying our scope. I also agree this question would also be answered well on an R forum. Given our current traffic, I'd rather be permissive, build community, and narrow scope later with more data (and traffic) than exclude what looks reasonable for now. – Geoff Oxberry Dec 05 '13 at 19:53
1 Answers
3
For the sake of completeness of the answer, you can use ls() to list all the assigned variables and data frames. This is similar to who and whos in Matlab.
If you want to get the list data.frames only you can use something like this:
ls()[grepl('data.frame', sapply(ls(), function(x) class(get(x))))]
You should probably ask questions like this on R forums.
-
-
Basic programming questions are better off for Stack overflow (43055 questions with R tag). Cross validated has a lot of R-related material from the stats point of view (4984 questions with R tag). – ivan-k Dec 05 '13 at 19:54
-
Thank you very much. I stumbled upon this rich trove of knowledge so I am mapping my way. – user3067676 Dec 05 '13 at 19:55