专家 R 用户,您的 .Rprofile 中有什么? [英] Expert R users, what's in your .Rprofile?
本文介绍了专家 R 用户,您的 .Rprofile 中有什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我总是发现其他人的启动配置文件对这门语言既有用又有益.此外,虽然我对 Bash 和 Vim,我对 R 一无所知.
I have always found startup profile files of other people both useful and instructive about the language. Moreover, while I have some customization for Bash and Vim, I have nothing for R.
例如,我一直想要的一件事是窗口终端中输入和输出文本的不同颜色,甚至可能是语法突出显示.
For example, one thing I always wanted is different colors for input and output text in a window terminal, and maybe even syntax highlighting.
推荐答案
这是我的.它不会帮助你着色,但我从 ESS 和 Emacs 那里得到了......
Here is mine. It won't help you with the coloring but I get that from ESS and 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
这篇关于专家 R 用户,您的 .Rprofile 中有什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文