如何使用循环遍历所有包含列表的列的unnest_wider?

问题描述

我有以下数据

A   B            C             D
1   1501583974   <list [3]>  <tibble>
1   1501616585   <list [3]>  <tibble>
1   1501583344   <list [3]>  <tibble>
1   1501573386   <list [3]>  <tibble>

我使用的代码

data %>%
unnest_wider(c,names_sep="_") %>%
unnest_wider(d,names_sep="_")

提供输出

    A   B            C_1  C_2 C_3  D_1         D_2   
    1   1501583974   1    2   3   <list [1]>  <list [1]>
    1   1501616585   1    2   3   <list [1]>  <list [1]>
    1   1501583344   1    2   3   <list [1]>  <list [1]>
    1   1501573386   1    2   3   <list [1]>  <list [1]>

,然后在所有列上再次执行unnest_wider()十分繁琐。
如何设计一个循环,直到所有带有列表的列都未嵌套为止?

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)