-
Notifications
You must be signed in to change notification settings - Fork 0
/
.Rprofile
40 lines (33 loc) · 959 Bytes
/
.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
if (interactive()) {
suppressWarnings(require(usethis, quietly = TRUE))
suppressWarnings(require(devtools, quietly = TRUE))
cat("\014") # clear screen
cli::cli_text("")
cli::cli_alert_info(R.version$version.string)
cli::cli_text("")
# customise the prompt
prompt::set_prompt(function(...) {
branch <- suppressWarnings(purrr::safely(gert::git_branch)())
if (is.null(branch$result)) {
return("> ")
}
return(paste0("[", branch$result, "] > "))
})
# usethis options
options(usethis.protocol = "ssh")
options(usethis.full_name = "gongcastro")
# bias against scientific notation
options(scipen = 4)
# print loaded packages
cli::cli_alert_success(
paste0(
"Loaded: ",
paste0(
sessioninfo::session_info()$packages[sessioninfo::session_info()$packages$attached, 1],
collapse = ", "
)
)
)
cli::cli_text("")
load_all()
}