熟練した R ユーザーの皆さん、.Rprofile には何が含まれていますか? [closed] 質問する

熟練した R ユーザーの皆さん、.Rprofile には何が含まれていますか? [closed] 質問する

私は他の人のスタートアッププロファイルファイルが言語について役に立つだけでなく、勉強にもなると感じています。さらに、バッシュそしてヴィム、Rについては何もないです。

たとえば、私が常に望んでいたことの 1 つは、ウィンドウ ターミナルでの入力テキストと出力テキストに異なる色を使用すること、さらには構文の強調表示です。

ベストアンサー1

これが私のものです。色付けには役立ちませんが、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

おすすめ記事