简体   繁体   English

install.packages()的日志

[英]Log of install.packages()

Does R by default store a log of the installation messages anywhere? R默认情况下是否在任何地方存储安装消息的日志? If not, is there a way to have it log them on a file? 如果没有,有没有办法让它将它们记录在文件中?

Sometimes I let R install various pacakges automatically, eg 有时我让R自动安装各种pacakges,例如

install.packages("caret", dependencies=c("Depends", "Suggests"))

which can take hours and the installation log does not fit on the scroll buffer, so I can't see how the installation proceeded. 这可能需要几个小时,安装日志不适合滚动缓冲区,所以我看不到安装是如何进行的。 It would be great if I can have R save this log somewhere (in addition to showing it on the terminal) 如果我可以将R保存在某处(除了在终端上显示),这将是很棒的

If you only need to know how the installation went (warnings and errors), the following may be sufficient for your needs: 如果您只需要知道安装的方式(警告和错误),以下内容可能足以满足您的需求:

sink("sink.txt")
install.packages("caret", dependencies=c("Depends", "Suggests"))
sink()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM