I have hundreds of data frames in my global environment, and I would like to merge them accordingly to the name of the data frame. Each data frame is different, but the first two letters of the data frame determine the group. Since I have hundreds of data frames per group, I would like them to be in just one data frame. So I have group AB, AC, and K. Each group contains the last name of a participant after the first two letters (AB_James, AC_william, etc). So I need to merge them accordingly two the first two letters, which determine the group. Every data frame contained the same amount of observations and variables.
I know that the ls() function should be involved, but I am unable to find a way of doing it.
Is there a way of executing something like this?