Skip to content

Instantly share code, notes, and snippets.

@mschubert
Last active Apr 28, 2017
Embed
What would you like to do?
# 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