0

I am unable to format columns after exporting with the following function:

write.xlsx(df, file=paste0("H:/OrderReport/Orders_", today, ".xlsx"))

I am getting the following messages to the console.

adding: xl/worksheets/ (164 bytes security) (stored 0%)
adding: xl/worksheets/sheet1.xml (164 bytes security) (deflated 84%)

I read the documentation at https://cran.r-project.org/web/packages/openxlsx/openxlsx.pdf, however, I could not find much information about the compression option and how to turn it off. I was going to try to turn off the compression listed above to see if that allowed me to format columns in the Excel output.

options("openxlsx.compressionLevel" = "9")
## set zip compression level, default is "1".
Andrew Borst
  • 338
  • 3
  • 12
  • I saved it as a CSV and was able to format columns in Excel. I think the problem is that in the data frame all columns are factors. I may take time to declare types when creating the data frame or find a simple way for R to take a data frame and redo the types. – Andrew Borst Jun 04 '18 at 15:10
  • What do you mean by "format columns"? Do you want to do formatting by R or Excel? BTW, there is nothing wrong with those messages you are getting. Don't you have a file as the result of `write.xlsx`? – djhurio Jun 04 '18 at 15:23

0 Answers0