openxlsx2 icon indicating copy to clipboard operation
openxlsx2 copied to clipboard

Inconsistent `wb_dims` return when row vector contains 1

Open sTeADone opened this issue 7 months ago • 2 comments

wb_dims gives weird dimension range when the rows argument is a vector and the vector contains 1.

r$> packageVersion("openxlsx2")
[1] '1.8.0.9000'

r$> wb_dims(rows = c(2,30), cols = 2)
[1] "B2:B2,B30:B30"

r$> wb_dims(rows = c(1,30), cols = 2)
[1] "B1:B2"

r$> wb_dims(rows = c(2,30), cols = c(2,4))
[1] "B2:B2,D2:D2,B30:B30,D30:D30"

r$> wb_dims(rows = c(1,30), cols = c(2,4))
[1] "B1:B2,D1:D2"

r$> wb_dims(rows = c(2,1), cols = c(2,4))
[1] "B1:B2,D1:D2"

r$> wb_dims(rows = c(5,1), cols = c(2,4))
[1] "B1:B2,D1:D2"

sTeADone avatar Jul 30 '24 08:07 sTeADone