-
Notifications
You must be signed in to change notification settings - Fork 1
/
.Rprofile
41 lines (34 loc) · 1.19 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
local({
options("repos" = c(CRAN="https://cran.rstudio.com"))
})
if (interactive()) {
.os <- tolower(Sys.info()[["sysname"]])
.detach <- function(package) {
pkg <- deparse(substitute(package))
pkg <- paste(unlist(strsplit(pkg, "\"")), collapse="")
expr <- paste0("detach(package:", pkg, ", unload=TRUE)")
tryCatch(
eval(parse(text=expr)),
error = function(c) {
c$message <- paste0("Package ", pkg, " is not attached.\n")
message(c)
}
)
}
.cleanup <- function() {
for (i in 1:10) gc()
}
exit <- Q <- function(save = "no", status = 0, runLast = TRUE) {
q(save = save, status = 0, runLast = TRUE)
}
# package libraries
.Library.user <- Sys.getenv('R_LIBS_USER')
.Library.dev <- "~/R-dev"
# check for package updates and notify user (but don't install them)
if (!is.null(utils::old.packages(lib.loc = c(.Library.site[1], .Library.user))))
print("Package updates available.")
# load devtools and set dev library
suppressMessages(library(devtools))
options(devtools.name = "Alex Chubaty",
devtools.desc.author = 'person(c("Alex", "M"), "Chubaty", email = "[email protected]", role = c("aut", "cre"))')
}