如何将R会话记录到文件? [英] How do I log an R session to a file?

查看:57
本文介绍了如何将R会话记录到文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了通过捕获整个会话的重定向之外,还有没有办法在R会话期间启动和停止日志记录?为了澄清起见,我正在寻找与Stata中的log using命令类似的内容.

Other than through redirection, which captures an entire session, is there a way to start and stop logging during an R session? To clarify, I am looking for something similar to the log using command in Stata.

推荐答案

您知道基数R中的sink()吗?

CRAN上还有一些日志记录软件包:日志记录

There are also some logging packages on CRAN: logging, log4r and possibly more.

最后,Emacs用户拥有ESS及其脚本模式.您可以将会话另存为日志,通常,从文件开始工作并从文件执行"方法在工作时会建立(部分,仅命令的)日志.

Lastly, Emacs user have ESS and its transcript mode. You can save your session as a log, and in general, the 'work from file and execute from the file' approach builds a (partial, commands-only) log as you work.

这篇关于如何将R会话记录到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆