Skip to content

How to print colorful R output??

5 messages · Yihui Xie, Liviu Andronic, casperyc +1 more

#
Yes (depending on what you mean by "output"), but maybe there is a
long way to go. The vignette of the Rd2roxygen package is an example:
http://cran.r-project.org/web/packages/Rd2roxygen/vignettes/Rd2roxygen.pdf

It makes use of the highlight package and Sweave to output colored
code. If the style of the above vignette is what you want, more
details are here:
http://yihui.name/en/2010/10/how-to-start-using-pgfsweave-in-lyx-in-one-minute/

Regards,
Yihui
--
Yihui Xie <xieyihui at gmail.com>
Phone: 515-294-2465 Web: http://yihui.name
Department of Statistics, Iowa State University
2215 Snedecor Hall, Ames, IA
On Fri, Dec 10, 2010 at 3:53 PM, casperyc <casperyc at hotmail.co.uk> wrote:
#
Hello
On Fri, Dec 10, 2010 at 10:53 PM, casperyc <casperyc at hotmail.co.uk> wrote:
I once asked for this on the list [1], and the are two points:
- although technically feasible, say using ncurses, there are
currently no facilities for automated formatting of input/output
- go for editors that do this automatically, say Emacs or JGR

Regards
Liviu

[1] http://www.mail-archive.com/r-help at r-project.org/msg86512.html
1 day later
#
Hi All,

My aim is actually not that complicated as you guys understand.

What I want is this,

when I print it by clicking 

File--> Print...

It gaves me a black white output.

But what I want is

'red', for all the codes i typed in,
'blue', for the R output,

just like the console.

Thanks!

(I am using windows xp)

casper
#
One possibility, though not as simple as what you ask for, is to use etxtStart and friends from the TeachingDemos package.

Other possibilities include using gui interfaces to R, possibilities (though they may do more than you ask, and color might be different) include emacs/ess; vim; jgr; and others.