I have a dataframe that I have applied a space between each group in a given category using the following code.
DF2 <- head(do.call(rbind, by(DF, DF$AcctName, rbind,"")), -1)
Whenever I try to use DF2 in an openxlsx script with the following number format, the resulting Excel file has no formatting and only the raw data. What is causing the script to not apply the format to the Excel file, as the script works normally if I do not perform the rbind code adding the spacing?
addWorksheet(wb, "Sheet")
writeData(wb, "Sheet", DF2, startCol = 2, startRow = 2)
midStyle <- createStyle(halign = "center", numFmt = "#,##0;-#,##0;-")
addStyle(wb, "Sheet", midStyle, rows = 2:18, cols = 2:55, gridExpand = T)