Open hughjonesd opened 5 years ago
This is a tricky bug, because it only appears on win-builder. As a result, I can't get a minimal working example.
huxtable depends on openxlsx to write to Excel files. It does so cell-by-cell, allowing for different styles or even numeric formats in each cell.
huxtable
openxlsx
On most platforms, the following test works:
hx <- huxtable(a = 1:2 + 0.5, b = -1:-2 + 0.5, d = letters[1:2], add_colnames = TRUE) wb <- as_Workbook(hx) openxlsx::saveWorkbook(wb, file = "test-xlsx.xlsx", overwrite = TRUE) dfr <- openxlsx::read.xlsx("test-xlsx.xlsx") expect_equal(dfr[[1]], 1:2 + 0.5)
The code for as_Workbook is visible at https://github.com/hughjonesd/huxtable/blob/master/R/Workbook.R .
as_Workbook
But on win-builder it fails, with dfr[[1]] equal to 1:2 rather than c(1.5, 2.5).
1:2
c(1.5, 2.5)
I don't know exact win-builder details, but whatever is on there. I can't reproduce the problem on appveyor or on any non-Windows platform.
Any ideas of what might cause such a bug?
Expected Behavior
This is a tricky bug, because it only appears on win-builder. As a result, I can't get a minimal working example.
huxtable
depends onopenxlsx
to write to Excel files. It does so cell-by-cell, allowing for different styles or even numeric formats in each cell.On most platforms, the following test works:
The code for
as_Workbook
is visible at https://github.com/hughjonesd/huxtable/blob/master/R/Workbook.R .Actual Behavior
But on win-builder it fails, with dfr[[1]] equal to
1:2
rather thanc(1.5, 2.5)
.sessionInfo()
I don't know exact win-builder details, but whatever is on there. I can't reproduce the problem on appveyor or on any non-Windows platform.
Any ideas of what might cause such a bug?