I gathered different lists from the RISMed package and would like to know how to combine to lists of different lengths and then transform them into a data frame.
List #1 with Authors' names:
[[1]] - First element of the list
LastName ForeName Initials order
1 Ellis Peter M PM 1
2 Verma Sunil S 2
3 Sehdev Sandeep S 3
4 Younus Jawaid J 4
5 Leighl Natasha B NB 5
List #2 with PubMed IDs
[[1]] - First element of the list
27998745
I managed to compile all the authors into one dataset through the ldply function of the plyr package. However, I would like to merge it with the PubMed IDs. Exemple below:
LastName ForeName Initials order PubMedID
1 Ellis Peter M PM 1 27998745
2 Verma Sunil S 2 27998745
3 Sehdev Sandeep S 3 27998745
4 Younus Jawaid J 4 27998745
5 Leighl Natasha B NB 5 27998745
That being done for all the ~5000 IDs I have.
Thanks a lot,
Romain
EDIT: This works fine but for one article at a time. Result<- cbind(List1[[2]],PubMedID= List2[[2]])
The mapply function does not work as it puts different lists (e.g. forenames) into different variables. The PubMedID got into a row but not listed.