-
Notifications
You must be signed in to change notification settings - Fork 0
/
rprofile
executable file
·63 lines (46 loc) · 1.26 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/usr/bin/env r
# -*- coding: utf-8 -*-
.libPaths("/usr/local/lib/R/site-library/")
local({r <- getOption("repos")
r["CRAN"] <- "https://cran.r-project.org"
options(repos=r)
})
options(stringsAsFactors=FALSE)
options(max.print=100)
options(scipen=10)
options(editor="vim")
# options(show.signif.stars=FALSE)
options(menu.graphics=FALSE)
options(prompt="> ")
options(continue="... ")
options(width = 80)
#' Add together two numbers.
#'
#' @param package_name String name of package to check for.
#' @return TRUE if \code{package_name} is installed, else FALSE.
#' @examples
#' is.installed('devtools')
is.installed <- function(package_name) {
package_name %in% rownames(utils::installed.packages())
}
##############################
# devtools install requires:
# brew install coretools
# brew install libgit2
# brew install zlib
##############################
if (!is.installed('devtools')) {
utils::install.packages('devtools', repos=getOption("repos")["CRAN"], dep=TRUE)
} else {
library(devtools)
}
if(Sys.getenv("TERM") == "xterm-256color") {
if(!is.installed('colorout')) {
install_github('jalvesaq/colorout')
} else {
library(colorout)
}
}
q <- function (save="no", ...) {
quit(save=save, ...)
}