diff options
author | Azat Bahawi <azat@bahawi.net> | 1970-01-01 03:00:00 +0300 |
---|---|---|
committer | Azat Bahawi <azat@bahawi.net> | 2022-09-20 11:51:54 +0300 |
commit | 38bab29776950ac2364ed64195b89887717c33de (patch) | |
tree | edaaf366a55dbe96d268019124536bc504c64e87 /r/.Rprofile |
Diffstat (limited to '')
-rw-r--r-- | r/.Rprofile | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/r/.Rprofile b/r/.Rprofile new file mode 100644 index 0000000..a4afb3b --- /dev/null +++ b/r/.Rprofile @@ -0,0 +1,71 @@ +local({ + r <- getOption("repos") + r["CRAN"] <- "http://cran.revolutionanalytics.com" + options(repos = r) +}) + +options(prompt="λ ") +options(continue=" … ") + +options("digits.secs" = 3) +options(browserNLdisabled = TRUE) +options(editor = "vim") +options(error = NULL) +options(max.print = 100) +options(max.print = 500) +options(menu.graphics = FALSE) +options(scipen = 10) +options(show.signif.stars = FALSE) +options(showErrorCalls = TRUE) +options(showWarnCalls = TRUE) +options(stringsAsFactors = FALSE) +options(warn = 0) +options(warnPartialMatchDollar = TRUE) +options(width = 80) + +q <- function (save = "no", ...) + quit(save = save, ...) + +utils::rc.settings(ipck = TRUE) + +.First <- function() +{ + if (interactive()) + { + library(utils) + timestamp(prefix = paste("##------ [", getwd(), "] ", sep = "")) + } +} + +.Last <- function() +{ + if (interactive()) + { + hist_file <- Sys.getenv("R_HISTFILE") + if (hist_file == "") + hist_file <- "~/.RHistory" + savehistory(hist_file) + } +} + +if (Sys.getenv("TERM") == "xterm-256color") + library("colorout") + +.env <- new.env() + +.env$unrowname <- function(x) +{ + rownames(x) <- NULL + x +} + +.env$unfactor <- function(df) +{ + id <- sapply(df, is.factor) + df[id] <- lapply(df[id], as.character) + df +} + +attach(.env) + +# vim: filetype=r |