-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rprofile
executable file
·78 lines (72 loc) · 2.21 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# CRAN mirror --------------------------------------
# options(repos = c("https://cran.ism.ac.jp/", "http://cloud.r-project.org/"))
# Nvim-R -------------------------------------------
if (interactive() &&
Sys.info()[["sysname"]] == "Linux" &&
Sys.getenv("DISPLAY") == "") {
if (Sys.getenv("TMUX") != "") {
options(browser = function(u) system(paste0("tmux new-window 'w3m ", u, "'")))
} else if (Sys.getenv("NVIMR_TMPDIR") != "") {
options(browser = function(u) {
.C(
"nvimcom_msg_to_nvim",
paste0('StartTxtBrowser("w3m", "', u, '")')
)
})
}
}
if (any(grepl("colorout", utils::installed.packages()))) {
library(colorout)
setOutputColors256(
normal = 7, negnum = 3, zero = 3, number = 3,
date = 3, string = 6, const = 1, false = 1,
true = 1, infinite = 2, stderror = 4,
warn = c(1, 0, 5), error = c(1, 4, 236),
verbose = FALSE, zero.limit = NA
)
}
# Japanese environments ----------------------------
if (Sys.info()[["sysname"]] == "Darwin") {
setHook(
packageEvent("grDevices", "onLoad"),
function(...) grDevices::pdf.options(family = "Japan1GothicBBB")
)
setHook(
packageEvent("grDevices", "onLoad"),
function(...) grDevices::ps.options(family = "Japan1GothicBBB")
)
setHook(
packageEvent("grDevices", "onLoad"),
function(...) {
grDevices::quartzFonts(serif = grDevices::quartzFont(
c(
"Hiragino Mincho ProN W3",
"Hiragino Mincho ProN W6",
"Hiragino Mincho ProN W3",
"Hiragino Mincho ProN W6"
)
))
grDevices::quartzFonts(sans = grDevices::quartzFont(
c(
"Hiragino Kaku Gothic ProN W3",
"Hiragino Kaku Gothic ProN W6",
"Hiragino Kaku Gothic ProN W3",
"Hiragino Kaku Gothic ProN W6"
)
))
# grDevices::quartz.options(family="sans")
}
)
attach(NULL, name = "MacJapanEnv")
assign("familyset_hook",
function() {
if (names(dev.cur()) == "quartz") par(family = "sans")
},
pos = "MacJapanEnv"
)
setHook("plot.new", get("familyset_hook", pos = "MacJapanEnv"))
options(X11fonts = c(
"-alias-gothic-%s-%s-*-*-%d-*-*-*-*-*-*-*",
"-adobe-symbol-*-*-*-*-%d-*-*-*-*-*-*-*"
))
}