Template issue with openxlsx using R

515 Views Asked by At

My goal is to construct an Excel spreadsheet that contains all of the formatting for my data and to only use openxlsx via R to write dataframes to the file. However, when I tried to do so, the formatting in the file is overwritten. I am calling the function in this manner:

writeDataTable(wb,1,wl, 1,2,colNames=FALSE, rowNames=FALSE, 
               tableStyle="none", withFilter = FALSE, 
               bandedRows=FALSE, stack = TRUE)  

Please advise. thanks

1

There are 1 best solutions below

2
Ben Jacobson On

I'll suggest that writeDataTable may be the cause of your problem as it applies formatting by definition.

Write to a worksheet and format as an Excel table

I recommend testing with writeData.