当以批处理模式运行时,我想更好地了解 R 脚本中语句的执行持续时间。有没有好的方法来做到这一点?
我有一个想法,我很想看到这件事完成。当批量执行时,源将回显到指定的日志文件。有没有办法让它在这个日志文件中的源代码旁边回显一个时间戳?
> R CMD BATCH script.R script.Rout
这是我今天看到的输出。
> tail -f script.Rout
...
> # features related to the date
> trandateN <- as.integer(trandate)
> dayOfWeek <- as.integer(wday(trandate))
> holiday <- mapply(isHoliday, trandate)
我想看类似...
> tail -f script.Rout
...
2013-06-27 11:18:01 > # features related to the date
2013-06-27 11:18:01 > trandateN <- as.integer(trandate)
2013-06-27 11:18:05 > dayOfWeek <- as.integer(wday(trandate))
2013-06-27 11:19:02 > holiday <- mapply(isHoliday, trandate)