I have a list of dataframes such as follows:
x <- c(1, 2, 3, 4, 5)
y <- c(5, 4, 3, 2, 1)
df1 <- data.frame(x)
df2 <- data.frame(y)
x <- list(df1, df2)
I want to print the names of the dataframes in list x
with a for loop such as this:
for (i in x) {
deparse(substitute(x[i]))
}
But it doesn't work. My goal is to have the names of the dataframes printed out as characters such as this:
[1] df1
[2] df2
Thanks!