From 38bab29776950ac2364ed64195b89887717c33de Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Thu, 1 Jan 1970 03:00:00 +0300 Subject: chore: init --- r/.Rprofile | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 r/.Rprofile (limited to 'r/.Rprofile') 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 -- cgit 1.4.1