【发布时间】:2013-03-29 18:47:34
【问题描述】:
我对如何让Rprof 与 R 合作感到困惑。
我按照文档中的示例进行操作,得到了类似
Rprof(filename="testProfile.out")
test()
Rprof(NULL)
summaryRprof("testProfile.out")
但是,在testProfile.out 里面,我有一行:sample.interval=20000
这让我很困惑,当我运行summaryRProf 时,我得到no events were recorded
任何建议将不胜感激。
【问题讨论】:
-
test() 是做什么的? Rprof 配置工作代码。所以如果test()返回一个函数test()找不到的错误,那么就没有事件要记录了。
-
嗯.. 假设 test = function() { for (i in 1:50) print(i) }
-
作为产生上述问题的示例
-
将
1:50更改为1:5000,您将开始看到东西。实际上,您的test()对于默认的interval = 0.02来说太快了。你也可以尝试分析for (i in 1:100) test()。
标签: r