I've been working on several hundred files, which I automatically loaded into the workspace as separate dataframes (let's assume I have 500 dataframes in my workspace).
I would like to create a list consisting of all dataframes/objects in the workspace and to apply a function on all of them. Of course I could type all the objects manually, but it is not very efficient for hundreds or thousands of dataframes. I was wondering whether there is any way I can use the output of ls()
function e.g.:
ls()
[1] "a" "b" "c" "d"
[5] "e" "f" "g" "h"
[9] "i" "j" "k" "l"
[13] "m" "n" "o" "p"
...
Unfortunately, when I extract from ls()
output, I only end up with a character vector of strings and not a list of dataframes.
I would appreciate your ideas. Thanks.
EDITED: the following page How do I make a list of data frames in r gives some background but it doesn't answer my question as it doesn't cover large amounts of dataframes.