I have a question for rbind in R
I have multiple data frames
df1 <- data.frame (first_column = c("1", "2"),
second_column = c("3", "4")
)
df2 <- data.frame (first_column = c("1", "2"),
second_column = c("3", "4")
)
df3 <- data.frame (first_column = c("1", "2"),
second_column = c("3", "4")
)
I would like to merge these dataframes but separate them with a title, the results would be:
first_column second_column
df1
1 1 3
2 2 4
df2
1 1 3
2 2 4
df3
1 1 3
2 2 4
I have tried rbind, I know I could manually insert df_name one by one, but if I have more than 10 dfs, that would not be feasible.
Thank you very much