Colorout for R

Sure that the ones that use in a regular way the statistic program called R know the unofficial package called colorout.

I just discover this package some weeks ago. It allows to add some color to R’s output. Just see:

R colorout

The source code of the package can be download from its page [1]. Following its instructions we open an R session and type:

download.file("http://www.lepem.ufc.br/jaa/colorout_1.0-2.tar.gz", destfile = "colorout_1.0-2.tar.gz")
install.packages("colorout_1.0-2.tar.gz", type = "source", repos = NULL)

With the package installed we will edit (or create) the .Rprofile file, located into our home. It is necessary to add the call to the library and its configuration:

library('colorout')
setOutputColors256(
    normal = 40,
    number = 214,
    string = 85,
    const = 35,
    stderror = 45,
    error = c(1, 0, 1),
    warn = c(1, 0, 100)
)
options(prompt="R> ")

And start working with the new colorized R session!

References:

  • [1] colorout: link
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: