The package "colorout" in CRAN is to colorize R output on terminal emulators. It considerably improves visibility in R interactive operations.
Although R usually works on ESS for me, to run R on a terminal emulator sometimes saves time when prompt or short trail or reading helps.
Since the default color palette is dissatisfied, I made a new color
setting with setOutputColors256()
.
> library("colorout") > setOutputColors256(normal = 252, number = 222, string = 203, + const = 120, stderror = c(3, 0, 244), + warn = c(1, 0, 1), error = c(1, 15), verbose = FALSE)
The result.
For always using it in gnome-terminal, the following was added into
$HOME/.Rprofile
to be run whenever starting R.
if(Sys.getenv("COLORTERM") != ""){ library("colorout") setOutputColors256(normal = 252, number = 222, string = 203, const = 120, stderror = c(3, 0, 244), warn = c(1, 0, 1), error = c(1, 15), verbose = FALSE) }
The environmental variable "COLORTERM" is set as "gnome-terminal" when I use gnome-terminal.
The screenshot by the author of colorout package is: .