我正在尝试确定grobWidth
应用于gtable
对象的问题(请参阅 参考资料gtable:::widthDetails.gtable
);当大小被指定为单位(unit.arithmetic
对象)的总和时,会出现问题,
library(grid)
u = unit(1,"npc") + unit(2,"mm")
grid:::absolute.units(u)
#Error in UseMethod("absolute.units") :
# no applicable method for 'absolute.units' applied to an object of class #"c('unit.arithmetic', 'unit')"
值得注意的是,absolute.size
工作,即使它调用grid:::absolute.units
,
grid::absolute.size(u)
#[1] 1null+2mm
这怎么可能?