Next: Executing commands from or diverting output to a file, Previous: R commands; case sensitivity etc, Up: Introduction and preliminaries
在大多數 UNIX 版本和 Windows 系統上,R 提供了一種 調用和重新執行先前用過的命令的機制。鍵盤上的上下鍵 可以使游標在命令的歷史記錄(command history)中前翻或者 後退。一旦找到某條具體的命令,游標可以通過 左右鍵移動,而且 可以插入其他字元或者用<DEL>鍵刪除字元。 更具體的內容可以參考:see The command-line editor.
UNIX 下面以前用過的命令的調用和編輯的鍵設置是可以修改的, 具體內容可以參考 readline 庫的指南。
特別提一下,Emacs 文本編輯器1 對交互使用 R 提供了更一般的機制 (主要是 ESS 和 Emacs Speaks Statistics)。See R and Emacs (The R statistical system FAQ).
[1] 譯者注:當然Vi,UltraEdit也不錯。我就用UltraEdit寫 R 代碼做蒙特卡羅模擬的。 在http://www.ultraedit.com/index.php?name=Content&pa=showpage&pid=40下載 R 的 wordfile (“R Scripting - 02/18/2003”,具體可能會有些不同),貼到你的 UltraEdit 程式根目錄下的 wordfile.txt 文件中就行了。這時候,自動會對 .R 檔語法高亮顯示。