-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rprofile
48 lines (40 loc) · 1.42 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
38
39
40
41
42
43
44
45
46
47
48
## Stolen/borrowed from http://gettinggeneticsdone.blogspot.com/2013/06/customize-rprofile.html
## Don't show those silly significanct stars
## Change prompt and set digits
## options(prompt="R> ", digits=4, show.signif.stars=FALSE)
options(prompt="R> ")
options(continue = " ")
options(max.print=1000)
options(nwarnings = 100) # controls max number of warnings printed with warnings()
options(error=utils::recover)
## http://stackoverflow.com/a/1173161/3275826
## ws <- function(howWide=Sys.getenv("COLUMNS")) {
## options(width=as.integer(howWide))
## }
##
## http://stackoverflow.com/q/7725152/3275826
## NP 26/02/14 seems like it calls this function after every task so need to type sth to get it to rerun sizing adjustments
## auto width adjustment
.adjustWidth <- function(...){
try(options(width=Sys.getenv("COLUMNS")), silent=TRUE)
TRUE
}
.adjustWidthCallBack <- addTaskCallback(.adjustWidth)
## Don't ask me for my CRAN mirror every time
r = getOption("repos")
r["CRAN"] = "https://cran.rstudio.com/"
options(repos = r)
rm(r)
## Source some function
source("~/.Rfunctions.R")
## .First() run at the start of every R session.
## Use to load commonly used packages?
.First <- function() {
cat(R.version.string, "\n")
cat("Successfully loaded .Rprofile at", date(), "\n")
}
## .Last() run at the end of the session
.Last <- function() {
# save command history here?
cat("\nGoodbye at ", date(), "\n")
}