After countless SO contributions about binding list of data, I'm embarrased to ask this question. However, I cannot seems to find on SO and come up with the right solution myself.
I have list which looks like this:
[[1]]
223586 <NA>
"James J." "Adress xxxxx"
[[2]]
12693738 <NA> <NA>
"Oliver M." "Address yyyyy" "Town xxxxx"
What I would like to get is: The missing filled with NA
<NA> <NA>
James J. Adress xxxxx NA
Oliver M. Address yyyyy town xxxx
I'm getting the last column (lenght 2) filled with name (first column entry)
James J. in this case:
do.call(rbind.data.frame, list)
NA NA NA
James J. Adress xxxxx James J.
Oliver M. Address yyyyy town xxxx
EDIT: There is nothing particular about this data. It is more about how to bind unequal length of data in list. There are either lapply(list, function(x) length(x))
length of 2 or 3 strings.
So I would like to replace the missing length 2
with NA
so that the list can be bind.