Skip to content

Instantly share code, notes, and snippets.

@ahasverus
Last active April 6, 2021 08:47
Show Gist options
  • Save ahasverus/8b41ceb0a9cf13107e5f4bf3d87bfb6b to your computer and use it in GitHub Desktop.
Save ahasverus/8b41ceb0a9cf13107e5f4bf3d87bfb6b to your computer and use it in GitHub Desktop.
R Script to customize R Startup File (macOS X)
## General Options ----
options(prompt = "> ", continue = "... ", width = 80, scipen = 100, warn = 0,
editor = "Atom", tab.width = 2)
## Graphical Device Dimensions ----
grDevices::quartz.options(width = 6, height = 6)
## CRAN Mirror ----
local({
r <- getOption("repos")
r["CRAN"] <- "https://pbil.univ-lyon1.fr/CRAN/"
options(repos = r)
})
## Quit R without Saving ----
.env <- new.env()
.env$q <- function(save = "no", ...) quit(save = save, ...)
attach(.env, warn.conflicts = FALSE)
## Print Message on R Loading/Quitting ----
.First <- function() { }
.Last <- function() { }
## RCompendium Credentials ----
options(given = "Nicolas", family = "Casajus", orcid = "0000-0002-5537-5294",
email = "[email protected]")
options(usethis.protocol = "ssh")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment