我想对使用RStudio编写的代码进行逐行审查。
我有两个问题:
谢谢!
**更新:考虑到我没有尝试直接从R / RStudio界面编写报告,我意识到我可以使用Notepad ++轻松打开和打印代码。所以,现在要记住大多数人可能用于编码的软件。
答案 0 :(得分:1)
我在https://statisticsglobe.com/r-save-all-console-input-output-to-file处找到了一个将脚本写入文本文件所遇到的类似问题的答案,并希望与面临同样困境的其他人分享。不幸的是,这种方法虽然没有写出行号。
#将当前打开的R脚本写入文件
fout =“ filpath / filename.txt”
cat(readChar(rstudioapi :: getSourceEditorContext()$ path, file.info(rstudioapi :: getSourceEditorContext()$ path)$ size),file = fout)
答案 1 :(得分:0)