2015-10-16 58 views
1

如果我通过.Rprofile>source("C:/..../Rscript.R)运行我的R脚本,(在启动RStudio时立即运行R脚本),我得到这个奇怪的错误:could not find function "flush.console"错误:找不到函数“flush.console”

如果我跑手到错误之后,块直(选择块和运行)它的工作原理。

该R脚本(使用相同的程序)等的作品在台式PC上。 (除了不是所有的库被加载,但这些都没有关系到R脚本,我试图执行。)

当错误可能是什么?

我使用的是最新版本的RRStudio。再次,这一切都在其他PC上运行。有人会建议这与PC相关,但我不知道如何。 (相同的系统,Windows 7

我读了一些关于Sys.sleep()的东西,但我删除了那一点,仍然得到error

我可能不太准确,以及未提供详细信息(使用R脚本一起),但将在需要时根据要求披露更多的信息。

+1

是,当你调用'flush.console'加载utils软件包?尝试使用'utils的:: flush.console' – Roland

+0

UFF,我只包括两个库:'MASS'和'lubridate'和现在的工作。 – Maximilian

+0

@Roland:的确,'utils'包与MASS库一起加载。谢谢! – Maximilian

回答

2

help("Startup")

Note that when the site and user profile files are sourced only the base package is loaded, so objects in other packages need to be referred to by e.g. utils::dump.frames or after explicitly loading the package concerned.