Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mschubert
Last active April 28, 2017 13:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mschubert/0ce46ffc599358c9c799487898860395 to your computer and use it in GitHub Desktop.
Save mschubert/0ce46ffc599358c9c799487898860395 to your computer and use it in GitHub Desktop.
# ignore system installation
# e.g. https://github.com/EBI-predocs/research-software/issues/57
.libPaths("~/.R")
# no factor coercion
# no graphical package install menu
# warn if partial matching arguments
options(
stringsAsFactors = FALSE,
menu.graphics = FALSE,
repos = c(CRAN="http://mirrors.ebi.ac.uk/CRAN/"),
warnPartialMatchAttr = TRUE,
warnPartialMatchDollar = TRUE
)
# on non-interactive scripts, display traceback on errors
if (!interactive())
options(error = function() {
traceback(2, max.lines=10)
quit(save="no", status=1)
})
# save history to use up-arrow/ctrl+r in new session
if (interactive()) {
.Last = function() try(utils::savehistory("~/.Rhistory"))
utils::loadhistory("~/.Rhistory")
}
@klmr
Copy link

klmr commented Apr 28, 2017

This should probably use R_HISTFILE instead of hardcoding the path. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment