我想写出一个.R
文件或创建一个R script
from 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
.
非常感谢任何帮助。谢谢!