Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setRowHeights produces a warning when applied after setColWidths (Version 4.2.7.1), if the data.frame contains large numbers #506

Closed
mkammer19 opened this issue Oct 9, 2024 · 1 comment

Comments

@mkammer19
Copy link

Using the function setRowHeights after defining column widths width setColWidths produces a warning message in openxlsx Version 4.2.7.1 if the data.frame to be written contains large numbers.

Example

# data.frame to be written to Excel-file
my_table <- data.frame(ID = seq(13274112109, length.out = 4), NAME = c("A", "B", "C", "D"))
# Create Workbook
wb <- createWorkbook()
addWorksheet(wb, "TABLE", orientation = "portrait")
# Write data.frame to workbook
writeData(wb, "TABLE", my_table, startRow = 1)
# Set column widths
setColWidths(wb, "TABLE", c(1, 2), widths = 20)
# Set row heights
setRowHeights(wb, "TABLE", seq(1, 5),  20)
# Warning message:
# In unlist(wb$sharedStrings[as.integer(val)[typ] + 1]) :
# NAs introduced by coercion to integer range

Expected behavior
setRowHeights should not return a warning message.

Thank you for this very useful package. I know that this isn't a critical bug, but it is quite annoying.

@JanMarvin
Copy link
Collaborator

Thanks, fixed. Caused by overflow in as.integer()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants