【问题标题】:Why is there no progress bar in dlply (in the R plyr package)为什么 dlply 中没有进度条(在 R plyr 包中)
【发布时间】:2012-06-27 00:12:13
【问题描述】:

我正在使用 plyr 包来处理列表和数据框。 我注意到以下行为:

示例 1 -

list_2 <- llply(list_1, function_1, .progress='text')

这按预期工作。它从 list_1 生成 list_2,并将 function_1 应用于每个 list_1 元素,我看到了进度条。

示例 2 -

list_3 <- dlply(list_2, function_2, .progress='text')

这也适用于我在 list_3 中得到我期望的结果,但是,我没有得到进度条。

总结一下,为什么进度条对dlply不起作用,对llply起作用。 (它也适用于 ldply)。

【问题讨论】:

    标签: r progress-bar plyr


    【解决方案1】:

    因为您没有将data.frame 拆分为任何内容。如果您的第二个示例是:

    list_3 <- dlply(df_2, .(colname2), function_2, .progress='text')
    

    然后它会工作。 plyr 中的进度条基于已完成的块数。

    【讨论】:

      猜你喜欢
      • 2017-07-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-06
      • 1970-01-01
      相关资源
      最近更新 更多