openxlsx2
openxlsx2 copied to clipboard
Non-Consecutive dim gets lost
library(openxlsx2)
# dims <- "B7:B9,C6:C10,D5:D11,E5:E12,F6:F13,G7:G14,H6:H13,I5:I12,J5:J11,K6:K10,L7:L9"
dims <- "B7:B9,C6:C10,D5:D11,E5:E12,G7:G14,H6:H13,I5:I12,J5:J11,K6:K10,L7:L9"
wb <- wb_workbook()$
add_worksheet(grid_lines = FALSE)$
set_col_widths(cols = "A:M", widths = 2)$
add_fill(dims = dims, color = wb_color("red"))
if (interactive()) wb$open()
I was toying around with coloring non consecutive cell ranges to create a heart shape using this as reference:
In my initial approach I missed a column, but to my surprise, column L is missing too (picture on the left). Even though it is in the code. If I use the full range, the image looks fine (picture on the right).