drflxms
2012-Jan-07 10:48 UTC
[R] colouring a table, data.frame or matrix in an interactive R session
Hi everybody, as I am dealing with complex confusion matrices, I wonder whether there might be a way to colour text/tabular data in R. I.e. imagine highlighting the true positive values or certain classes in a table. I know how to colour text in graphical output as well as how to sweave or odfWeave coloured tables. But is there a way to do it directly in an interactive R session? Of course I understand that terminals originally haven't been designed for coloured output and that one can easily extract every information needed by subscripting. But still coloured text in the interactive session would sometimes just be comfortable. Looking forward to read from you, Greetings from Munich, Felix
Michael Friendly
2012-Jan-07 20:12 UTC
[R] colouring a table, data.frame or matrix in an interactive R session
On 1/7/2012 5:48 AM, drflxms wrote:> Hi everybody, > > as I am dealing with complex confusion matrices, I wonder whether there > might be a way to colour text/tabular data in R. I.e. imagine > highlighting the true positive values or certain classes in a table. > > I know how to colour text in graphical output as well as how to sweave > or odfWeave coloured tables. But is there a way to do it directly in an > interactive R session? > Of course I understand that terminals originally haven't been designed > for coloured output and that one can easily extract every information > needed by subscripting. But still coloured text in the interactive > session would sometimes just be comfortable. >It depends on what kind of terminal you are using, but maybe not worth the effort. lattice::levelplot can do a nice job of coloring cells in a table.
Vincent Zoonekynd
2012-Jan-08 12:52 UTC
[R] colouring a table, data.frame or matrix in an interactive R session
On 7 January 2012 19:48, drflxms <drflxms at googlemail.com> wrote:> as I am dealing with complex confusion matrices, I wonder whether there > might be a way to colour text/tabular data in R. I.e. imagine > highlighting the true positive values or certain classes in a table.The "colorout" package does part of what you want: colouring the output, in a terminal. But some more work may be needed if you want to change the colours depending on the values of your matrix. -- Vincent