[Rd] Converting width for a grob where graphics parameters have length 0 crashes R

2021-11-13 Thread Gu, Zuguang
Dear developers, In grid::gpar(), graphic parameters are not allowed to have length 0, but this can be done by first creating a gpar object and later modifying it: gp = gpar(fontsize = 10) gp$fontsize = numeric(0) when a grob has a gp where some parameters have length 0, converting the

[Rd] Graphic parameters with length zero in grid cause R to crash

2020-05-19 Thread Gu, Zuguang
Hi, I found in grid package, if the graphic parameters have zero length, R crashes. In the following code, I only tested `grid.rect()` and the `fill` parameter, but I think it should be similar as other grid graphic functions. In `gpar()` function, the graphic parameters are not allowed to

[Rd] grid 4.0 generates wrong results when adding two complex units by sum()

2020-04-29 Thread Gu, Zuguang
Hi, In grid 4.0, adding two complex units by `sum()` seems to give wrong results. In the following example, `u1 + u2` gives the correct result, but `sum(u1, u2)` also `sum(unit.c(u1, u2))` give the wrong results. ``` library(grid) u1 = 0.4*sum(unit(1, "inch"), unit(1, "mm")) u2 =