Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

R 启动设置 #3

Open
JackieMium opened this issue Mar 8, 2018 · 0 comments
Open

R 启动设置 #3

JackieMium opened this issue Mar 8, 2018 · 0 comments
Labels
R R related 基础 很基础的东西
Milestone

Comments

@JackieMium
Copy link
Owner

2017-04-27

在 Linux 系统中,R 启动时默认加载 ~/.Rprofile 文件,这就为自定义多种 R 选项提供了方便。

我的~/.Rprofile文件内容:

# 设置启动时工作目录
setwd("/home/adam/Bioinformatics")

# 设置一些选项
options("pdfviewer"="evince")
options(prompt="R>", digits=4, show.signif.stars=TRUE)
options(menu.graphics=FALSE)
options(stringsAsFactors = FALSE)

# 设置默认镜像源
source("http://bioconductor.org/biocLite.R")
options(BioC_mirror="http://mirrors.ustc.edu.cn/bioc/")
options(repos=c("http://mirrors.ustc.edu.cn/CRAN/","https://mirrors.aliyun.com/CRAN/","http://mirrors.tuna.tsinghua.edu.cn/CRAN/"))

# 有用的小功能
cd <- setwd
pwd <- getwd
hh <- function(d) d[1:5,1:5]

# 经常需要的包
library("colorout")

# 加载完成后打印信息提示
message("###### SUCCESSFULLY LOADED. LET'S DO THIS! ######")
@JackieMium JackieMium added R R related 基础 很基础的东西 labels Mar 8, 2018
@JackieMium JackieMium added this to the Migration milestone Mar 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
R R related 基础 很基础的东西
Projects
None yet
Development

No branches or pull requests

1 participant