-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRprofile
More file actions
53 lines (48 loc) · 1.21 KB
/
Rprofile
File metadata and controls
53 lines (48 loc) · 1.21 KB
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
library(base)
library(utils)
print_version <- function() {
v <- R.Version()
ret <- paste0(
v$version.string,
", ",
v$nickname
)
return(ret)
}
less <- function(x) {
if (typeof(x) == "character") {
file.show(x)
} else {
page(x, method = "print")
}
}
see_package_code <- function(package_name) {
less(as.list(getNamespace(package_name)))
}
.First <- function() {
if (!nzchar(Sys.getenv("RADIAN_VERSION"))) {
Sys.setenv(R_HISTSIZE = 10000)
if (interactive()) try(loadhistory("~/.Rhistory_all"))
timestamp(quiet = T)
timestamp(stamp = print_version()) # , prefix = "", suffix = "")
timestamp(stamp = R.home(), quiet = T)
timestamp(stamp = getwd(), quiet = T)
} else {
timestamp(stamp = R.home(), quiet = T)
timestamp(stamp = getwd(), quiet = T)
}
options(max.print = 500)
}
.Last <- function() {
# filename <- paste0(
# "~/.R-saved-histories/",
# format(Sys.time(), "%y%m%d-%H%M%S"),
# ".Rhistory"
# )
if (!nzchar(Sys.getenv("RADIAN_VERSION"))) {
timestamp(quiet = T)
# savehistory(file = filename)
if (interactive()) try(savehistory("~/.Rhistory"))
if (interactive()) try(file.append("~/.Rhistory_all", "~/.Rhistory"))
}
}