Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 --save 命令运行 RSCript。当脚本完成时,如果我再运行“R”,我不会在脚本的工作区变量。我错过了什么?
谢谢。
尝试save.image()在脚本末尾包含。这将在您的工作目录中创建一个 .Rdata 文件,该文件将保存您的脚本创建的所有变量。要在下次打开 R 时加载该工作区,您可以输入load("present/working/directory/.Rdata")
save.image()
load("present/working/directory/.Rdata")
希望这就是你要找的。
Rscript 对我有用。需要使用命令la查看生成的文件.RData
Rscript --save test.R