我想写出一个.R文件或创建一个R scriptfrom R console,就像我们创建.txt文件一样。但是通常当我们写出.txt文件时,它们包含一些output而不是commands它。所以我想用 R 命令R script来console写它。save
我不确定R是否有这样的write.R东西。我尝试使用sink()命令,但又一次outputs the output and not commands。
sink("Rscriptfrom_Console.R")
sapply(iris,class)
sink()
创建一个R script file (.R) from R console using R commands.
非常感谢任何帮助。谢谢!