GithubHelp home page GithubHelp logo

colorout's Introduction

colorout

colorout is an R package that colorizes R output when running in a Unix (e.g. Linux and OS X) terminal emulator; it does not work on Microsoft Windows. The relevant code is written in C and, thus, it runs very quickly and you should not note any slowdown in R output.

R's stdout is parsed and numbers, negative numbers, dates in the standard format, strings, indices, and R constants are identified and wrapped by special ansi escape codes that are interpreted by terminal emulators as commands to colorize the output.

R's stderr is also parsed to identify the expressions "warning" and "error" and their translations to many languages. If these expressions are found, the output is colorized accordingly; otherwise, it is colorized as "stderror" (magenta, by default).

Customization

You can customize the colors according to your preference, guided by the color table made by the command show256Colors(). You can also set the colors to any arbitrary string. In this case, it is up to you to set valid values.

You can also call the function addPattern() to set your own patterns to be colorized.

Installation

You can install the package by running the following commands in a terminal emulator:

git clone https://github.com/jalvesaq/colorout.git
R CMD INSTALL colorout

Some people prefer to use devtools to install packages from github.

NOTES:

  • The package cannot be on CRAN because it changes code already loaded by R and this is prohibited by the CRAN Repository Policy. The package replaces the functions that output results and messages to R Console, and this is necessary because we cannot colorize the output without replacing these functions.

  • Because the package is not on CRAN, it is better to load it with require() rather than library() to avoid error in your ~/.Rprofile after upgrading R.

Previous Versions:

Recently released versions are available at https://github.com/jalvesaq/colorout/releases and older versions are at https://drive.google.com/open?id=0ByMBQcSs9G7KYkotRGpRYjlLVDg

Screenshot:

Screenshot

colorout's People

Contributors

bollard avatar csgillespie avatar jalvesaq avatar joshuaulrich avatar lukaszdaniel avatar nfultz avatar rsaporta avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.