r/R_Programming • u/snicksn • Jul 25 '16
Nested list to df?
I have a list that looks like below. Problem is there is a nested list ($toLoc) inside.
[[1]]
[[1]]$timeAtLoc
[1] "2016-07-29T00:20:00"
[[1]]$id
[1] "83"
[[1]]$toLoc
[[1]]$toLoc[[1]]
[1] "LA"
[[1]]$toLoc[[2]]
[1] "NY"
[[1]]$num
[1] "3"
I think I want to get it all in a (long) df looking something like:
id timeAtLoc toLoc
83 2016-07-26T00:26:00 LA
83 2016-07-26T00:26:00 NY
Any advice?
Thanks
2
Upvotes
View all comments
Show parent comment
1
u/[deleted] Aug 13 '16
Sorry for the late response. I really wouldn't be able to say unless I was playing and tinkering with it myself.