我通常会整天打开R控制台,但有时需要清理历史记录和工作区背景以测试功能或新负载。我想知道是否有更简单的方法在.Rprofile中使用命令行,这样我就可以在不退出或重启的情况下刷新R控制台。我现在通常为此目的做的是q()
没有保存,然后启动R并清理历史记录。我想这里有人可能会给我一些建议。提前谢谢。
答案 0 :(得分:0)
对于历史问题,在类似UNIX的系统(我的是Debian)中,这个命令会刷新它
loadhistory("")
但是,如评论中所述,loadhistory
似乎与平台有关。
检查平台上是否存在?loadhistory
。我说:
There are several history mechanisms available for the different
R consoles, which work in similar but not identical ways. There
are separate versions of this help file for Unix and Windows.
The functions described here work on Unix-alikes under the
readline command-line interface but may not otherwise (for
example, in batch use or in an embedded application)