On 03/19/2010 12:37 PM, rtist wrote:

Hi all,

I was wondering if there is a way to output text tables with the color of
the text corresponding to a condition.

More specifically, I"m outputting an time series table and want the console
colors to be green>0 and red<0.
This is very easy to do in excel using conditional formatting. Any ideas on
how to do it here?

Hi rtist,
If you want the whole table to be displayed in a color, you could do something like:

par(fg=ifelse(something > 0,"green","red"))

before you display the table. I am assuming that you want this on a graphics device, not the console in which R is running.

Jim

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to