Skip to content

Instantly share code, notes, and snippets.

@yanping
Created January 9, 2012 14:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanping/1583113 to your computer and use it in GitHub Desktop.
Save yanping/1583113 to your computer and use it in GitHub Desktop.
Sample Rprofile.site file
# 设置常用选项
options(papersize="a4")
options(editor="notepad")
options(pager="internal")
options(tab.width = 2)
options(width = 130)
options(graphics.record=TRUE)
options(show.signif.stars=FALSE)
# 设置R交互提示信息
options(prompt="> ")
options(continue="+ ")
.libPaths("C:/my_R_library") # 设置包的本地库(library)路径
# 设置CRAN镜像默认地址
local({r <- getOption("repos")
r["CRAN"] <- "http://cran.case.edu/"
options(repos=r)})
# 启动函数
.First <- function(){
library(lattice)
library(Hmisc)
source("C:/mydir/myfunctions.R")
cat("\nWelcome at", date(), "\n")
}
# 会话结束函数
.Last <- function(){
cat("\nGoodbye at ", date(), "\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment