I have a list and that contains elements as follow.
[[1]]
[[1]][[1]]
[[1]][[1]][[1]]
[[1]][[1]][[1]][[1]]
[1] "ip4"
[[1]][[1]][[2]]
[[1]][[1]][[2]][[1]]
[1] "ip1"
[[1]][[1]][[2]][[2]]
[1] "ip1"
[[1]][[1]][[3]]
[[1]][[1]][[3]][[1]]
[1] "ip6"
[[1]][[1]][[3]][[2]]
[1] "ip6"
[[1]][[2]]
[[1]][[2]][[1]]
[[1]][[2]][[1]][[1]]
[1] "ip4" "ip6"
[[1]][[3]]
list()
[[2]]
[[2]][[1]]
[[2]][[1]][[1]]
[[2]][[1]][[1]][[1]]
[1] "ip5"
[[2]][[1]][[1]][[2]]
[1] "ip5"
[[2]][[2]]
list()
[[3]]
[[3]][[1]]
[[3]][[1]][[1]]
[[3]][[1]][[1]][[1]]
[1] "ip10"
[[3]][[1]][[2]]
[[3]][[1]][[2]][[1]]
[1] "ip11"
[[3]][[1]][[3]]
[[3]][[1]][[3]][[1]]
[1] "ip3"
[[3]][[1]][[3]][[2]]
[1] "ip3"
[[3]][[2]]
[[3]][[2]][[1]]
[[3]][[2]][[1]][[1]]
[1] "ip11" "ip3"
[[3]][[3]]
list()
[[3]][[4]]
list()
I want to remove the lists which contains empty list and convert this list into a dataframe. So from the above list my desired output sholud be a dataframe that contains a list of vectors in its row. Dataframe myDf should be as follows.
myDF
col
ip4
ip1
ip1
ip6
ip6
c('ip4','ip6')
ip5
ip5
ip10
ip11
ip3
ip3
c('ip11','ip3') and to have list of dataframes where i will be having
col
[[1]]ip4
ip1
ip1
ip6
c('ip4','ip6')
col
[[2]] ip5
ip5
col
[[3]] ip10
ip11
ip3
ip3
c('ip11' , 'ip3')