Last active
May 27, 2025 11:39
-
-
Save even4void/99e40b772ec84b82eaef9bd2e5de0ace to your computer and use it in GitHub Desktop.
Old R stuff from years ago
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
R_LIBS_USER="~/.local/lib/R/library" | |
R_PROFILE="~/.config/R/Rprofile" | |
RENV_CONFIG_USER_PROFILE=TRUE | |
RENV_PATHS_ROOT="~/.cache/org.R-project.R/R/renv" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options(menu.graphics = FALSE) | |
options(width = 100, tibble.width = 100) | |
options(editor = "nvim") | |
options(languageserver.rich_documentation = FALSE) | |
options(error = function() traceback(3)) | |
makeActiveBinding(".__", function() .Last.value, .GlobalEnv) | |
.libPaths(c( | |
.libPaths(), | |
"/Users/chl/.local/lib/R/languageserver/renv/library/macos/R-4.4/aarch64-apple-darwin20" | |
)) | |
## RNG monitor (https://is.gd/ahZeuk) | |
if (interactive()) { | |
invisible(addTaskCallback(local({ | |
last <- .GlobalEnv$.Random.seed | |
function(...) { | |
curr <- .GlobalEnv$.Random.seed | |
if (!identical(curr, last)) { | |
msg <- "NOTE: .Random.seed changed" | |
if (requireNamespace("crayon", quietly = TRUE)) msg <- crayon::blurred(msg) | |
message(msg) | |
last <<- curr | |
} | |
TRUE | |
} | |
}), name = "RNG tracker")) | |
} | |
.First <- function() { | |
grDevices::quartz.options(width = 6, height = 6) | |
grDevices::palette("Tableau10") | |
} | |
.Last <- function() { | |
if (interactive()) { | |
hf <- Sys.getenv("R_HISTFILE") | |
if (hf == "") hf <- "~/.local/state/R_history" | |
savehistory(hf) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment