Hi all, just switching to R from matlab and running into some begginner issues. I would appreciate your help:
I have a bunch of variables in my workspace that are not data frames. I want to convert them to data frames to use them in ggplot. I tried to do it with a for loop but couldn't get it. I understand the issue but not how to solve it. Here's the code that I tried
#Listing all the variables
variables=ls()
#Removing the one that I don't want to transform
variables=variables[-c(1)]
#For loop to transform every variable into data.frame
for (value in variables)
{
#Creating a new variable to keep "value" intact
name=value
name=data.frame(name)
}
Of course I am just creating a new dataframe that has one value, the variables name. Instead, I want to keep the content of the variable with the name of the variable but as a data frame
Thanks in advance