我总是发现其他人的启动配置文件对于该语言既有用又具有启发性。此外,虽然我有一些定制Bash https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29 and Vim https://en.wikipedia.org/wiki/Vim_%28text_editor%29,我对R没有什么。
例如,我一直想要的一件事是窗口终端中的输入和输出文本具有不同的颜色,甚至可能是语法突出显示。
这是我的。它不会帮助你着色,但我从 ESS 和 Emacs 得到了它......
options("width"=160) # wide display with multiple monitors
options("digits.secs"=3) # show sub-second time stamps
r <- getOption("repos") # hard code the US repo for CRAN
r["CRAN"] <- "http://cran.us.r-project.org"
options(repos = r)
rm(r)
## put something this is your .Rprofile to customize the defaults
setHook(packageEvent("grDevices", "onLoad"),
function(...) grDevices::X11.options(width=8, height=8,
xpos=0, pointsize=10,
#type="nbcairo")) # Cairo device
#type="cairo")) # other Cairo dev
type="xlib")) # old default
## from the AER book by Zeileis and Kleiber
options(prompt="R> ", digits=4, show.signif.stars=FALSE)
options("pdfviewer"="okular") # on Linux, use okular as the pdf viewer