is it possible to do the following:
loc1 <- c("Aa", "Aa", "aa", "Aa")
loc2 <- c("aa", "aa", "aa", "AA")
loc3 <- c("aa", "Aa", "aa", "aa")
gen <- data.frame(loc1, loc2, loc3)
loc1g <- c(0.01, 0.5, 1, 0.75)
loc2g <- c(0.2, 0.1, 0.2, 0.6)
loc3g <- c(0.8, 0.8, 0.55, 1)
pval <- data.frame(loc1g, loc2g, loc3g)
I want to print to a file to gen dataframe such way that is conditionally formatted by the pval dataframe. Means than (row1, col1) of gen color depends upon pvale (row1, col1). The following are color coding:
0 to 0.3 is "red" text color
0.31 to 0.7 is "yellow"
> 0.7 is "red"
gen[1,1] will be "Aa" printed in red text color and so on....
appreciated your help.
EDITS:
I am more interested in printing not plotting in graph. If I can save output as MS excel and open in MSEXCEL it would be great. I can also be other types of text editors format that can read color coded text. As my orginal data matrix should be of a dimension of 1000 x 1000 or even more. I would like to quicky know unlying p-value for each gen categories.
ascii
package), but be prepared: basic R console/GUI/IDE will not be able to parse/colorize that. HTML/LaTeX/xls might be another option. – daroczig Oct 19 '11 at 21:40