I have list of year_month dataframes.
They are like this
List = c( A2017_1, A2017_2,....A2017_12, A2018_1, ... A2018_12, ..... )
and so on.
I want to rearrange this list with the months, like this:
month_1 = c(A2017_1, A2018_1, A2019_1, ....)
month_2 = c(A2017_2, A2018_2, A2019_2, ....)
.
.
... and so on.
This is what I tried.
for (x in 1:12){
LF <- emp_yymm[grep(str_c('+_', x,'$'), names(emp_yymm))]
LFF <-append(LFF, as.list(LF))
names(LFF)[x]<- str_c('mon_',x)
}
And it failed.