-2

How can I generate a list of all the variables that have been assigned in an R language session?

  • 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
  • 2
    I'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 Answers1

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.

M--
  • 103
  • 4
ivan-k
  • 233
  • 1
  • 5