-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rprofile
37 lines (30 loc) · 1.07 KB
/
.Rprofile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
############################################################
## Options for knitr and Rmarkdown rendering
############################################################
if(!"knitr" %in% installed.packages()[,'Package']){
install.packages('knitr')
}
if(!"rmarkdown" %in% installed.packages()[,'Package']){
install.packages('rmarkdown')
}
library("knitr")
library("rmarkdown")
## output directory for figures
if (require("knitr")) {
opts_chunk$set(fig.path="results/figures/")
opts_knit$set(base.dir=normalizePath(getwd()))
opts_knit$set(root.dir=normalizePath(getwd()))
}
############################################################
## the following is credit to Jenny Bryan, for details see here:
## https://gist.github.com/jennybc/362f52446fe1ebc4c49f
RPROJ <- list(PROJHOME = normalizePath(getwd()))
attach(RPROJ)
cat('Project home directory is available as PROJHOME or via get("PROJHOME","RPROJ")\n')
rm(RPROJ)
############################################################
local({
r <- getOption("repos")
r["CRAN"] <- "http://cran.cnr.berkeley.edu/"
options(repos = r)
})