I am working with the R programming language.
I have a list like this:
df_list <- list(
df1 = data.frame(A = 1:3, B = 4:6),
df2 = data.frame(A = 7:9, B = 10:12),
df3 = data.frame(A = 13:15, C = 16:18),
df4 = data.frame(A = 19:21, B = 22:24, C = 25:27)
)
For all data frames in this list that have the same number of columns AND the same column names, I want to put them into a separate list (e.g. list_1, list_2, list_3…).
Does anyone know if there is a quick way to do this in R?