-1

I have a list with a set of dataframes called 'a' and the structure is as shown in the following picture

enter image description here

I have another list with a set of dataframes called 'b' and having the same names as in 'a' and the structure is as shown in the following picture

enter image description here

i would like to combine the two dataframes in two lists as per their names into one list with dataframes.

for this, I am using the following code

c <-  Map(cbind, a, b)

but, the code is not working as it is giving the following output

enter image description here

the expected output will look very similar to as shown in the following picture

enter image description here

for instance in a list of length 49, a dataframe with 241 rows and 14 columns

I don't know what is the issue with the code...... looking to solve this problem I have tried all the options avalibale in stactoverflow to solve the problem

Kumar
  • 169
  • 1
  • 16
  • 1
    Can you create a small but reproducible example of the data that you have and show the expected output for it? Images are not the best way to share data. Read about [how to give a reproducible example](http://stackoverflow.com/questions/5963269). – Ronak Shah Jul 12 '21 at 11:26

1 Answers1

0

the problem is with the structure of the two dataframes are different and the problem is solved by converting the structure of two lists into the same structure.

i have converted the structure of list 'b' into tibble as

b <- tibble::as_tibble(b)

then we can use the code as following

c <-  Map(cbind, a, b)

this has worked solved my problem

Kumar
  • 169
  • 1
  • 16