conditional formating of cells in Excel with values coming from R
0
0
Entering edit mode
5 months ago

Hi,

I have a dataframe containing lists of genes names ("A" to "F") belonging to biological pathways :

df1 <- data.frame(Pathway=c("Pathway1","Pathway2"), Genes=c(("A,B,C,D"),("B,E,F"))

First, I'd like to export this data frame in excel

Then I'd like to color the genes ("A" to "F") according to their respectives log2FC values:

df2 <- data.frame(Genes=c("A","B","C","D","E","F"), log2FC=c(5,6,-4,-3,-1,2))

for example, genes with a positive log2FC value will appear in red in Excel and those with a negative value in green.

Before exporting the df1 in excel, do I first have to split the gene names and add them to separate columns ? Then it will be probably easier to color individual cells in excel with the conditionalFormatting function for example?

Maybe it's also not necessary to use Excel and to a directly get a graphical and colorized result with a R plot?

Thanks for your help!

conditional-formatting excel r • 250 views
ADD COMMENT

Login before adding your answer.

Traffic: 2745 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6