[R-pkgs] New package 'colorout' to colorize R output on terminal emulators

Jakson Alves de Aquino jalvesaq at gmail.com
Fri Nov 25 14:32:22 CET 2011

Dear R Community,

I'm pleased to announce the availability of 'colorout' on CRAN.
The package colorizes R output when it is running on a terminal

Screenshot: http://www.lepem.ufc.br/jaa/R_color_output.png

You can use either 16 colors (8 colors * 2 degrees of intensity)
or 256 colors to highlight normal text, numbers, strings,
warnings, errors and the keywords TRUE, FALSE, NA, NaN and Inf.

The package is not available for Windows, and there is no support
for Graphical User Interfaces, such as RStudio, RKward, JGR, Rcmdr
and other interfaces which have their own engine to display R
output. The colorization of output only works if R is compiled
for Unix systems and it is running interactively in a terminal
emulator (like when using RGedit or Vim-R-plugin).

The terminal must support Select Graphic Rendition (SGR, also
known as ANSI escape codes or sequences), otherwise you may see
garbage like this:

    > rnorm(5)
    [32m[ [33m1 [32m] [0m [32m  [33m0.07574585 [32m [0m [32m
    [33m0.88167822 [32m [0m [32m  [33m0.60788656 [32m [0m [32m
    [33m1.13590951 [32m [0m [32m  [33m1.07758879 [32m [0m [32m [0m

Notes for Emacs/ESS users:
  1. Emacs terminal does not support 256 colors.
  2. When the colorizing of R output is enabled, the ESS
     autocompletion of R object names and function arguments
     stops working on the R buffer.

Functions available in the package:

ColorOut:           Colorize R output in terminal emulator
noColorOut:         Stop colorizing R output
setOutputColors:    Set the colors to be used on R output
setOutputColors256: Set the colors to be used on R output
show256Colors:      Create and show a table with 256 colors

Any feedback will be appreciated.


Jakson Alves de Aquino
Federal University of Ceará
Social Sciences Department
jalvesaq at gmail.com

More information about the R-packages mailing list