I am trying to use rbind
on them. But I need a list of all the dataframes
that are already in my global environment. How can I do it?
Code
The ls
function lists all things in your environment. The get
function gets a variable with a given name. You can use the class
function to get the class of a variable.
If you put them all together, you can do this:
ls()[sapply(ls(), function(x) class(get(x))) == 'data.frame']
which will return a character vector of the data.frames in the current environment.