gpt4 book ai didi

r - 对 Rprof 和 R 感到困惑

转载 作者:行者123 更新时间:2023-12-04 10:27:01 25 4
gpt4 key购买 nike

我对如何让 Rprof 与 R 一起工作感到困惑。

我按照文档中的示例做了类似的事情

Rprof(filename="testProfile.out")
test()
Rprof(NULL)
summaryRprof("testProfile.out")

但是,在 testProfile.out 中,我有一行:sample.interval=20000

这让我很困惑,当我运行 summaryRProf 时,我得到 no events were recorded

如有任何建议,我们将不胜感激。

最佳答案

问题是我的测试完成得太快,而 Rprof 没有以足够快的间隔进行记录。要解决此问题,您可以设置 interval = 0.0002 或小于默认值 (0.02) 的某个数字。我还能够通过多次迭代运行我的测试来解决这个问题。

关于r - 对 Rprof 和 R 感到困惑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15866362/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com