[BioC] Exporting to excell with highlighted changes

Dan Tenenbaum dtenenba at fhcrc.org
Fri Sep 13 02:00:24 CEST 2013


Hi Patrick,

You might try the R-help list (https://stat.ethz.ch/mailman/listinfo/r-help) as this is not really a Bioconductor question.

Dan


----- Original Message -----
> From: "Patrick Schorderet" <patrick.schorderet at gmail.com>
> To: bioconductor at stat.math.ethz.ch
> Sent: Thursday, September 12, 2013 5:36:50 AM
> Subject: [BioC] Exporting to excell with highlighted changes
> 
> Dear All,
> I'm trying to compare two tables in R and find the differences
> between them (what has the user changed). The approach is the
> following:
> - Import .xls table into matrices
> - compare matrixes (and highlight differences)
> - output the 'new' table, with highlighted differences
> I can do all of this in R pretty easily, but the people I'm working
> with need a .xls file in return, with the highlighted changes (for
> example fill the cells which have changed with a color, or make them
> bold, etc).
> Any ideas?? Thanks for the help,
> Patrick
> PS: Here's the small script I have wrote so far. Ideally, M should
> carry some metadata around highlighting the differences I have
> applied.
> 
> library(compare)
> library(gdata)
> 
> # Load .xls file
> LoadXLSXFile <- function(file_name){
> 	X <- as.matrix(read.xls(paste("./Desktop/", file_name, sep="")))
> 	return(X)
> }
> 
> # Two matrices A and B of equal size
> A<-LoadXLSXFile("A.xlsx")
> B<-LoadXLSXFile("B.xlsx")
> M <- A
> booT <- which((A==B)==TRUE)
> M[booT] <- ""
> write.table(M, "./Desktop/ComparedOutput.xls", sep="\t", col.names =
> F, row.names = F)
> 
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
>



More information about the Bioconductor mailing list