r - missing S3 method but higher level-function works -
i'm trying pin down problem grobwidth applied gtable objects (see gtable:::widthdetails.gtable); issue arises when size specified sum of units (unit.arithmetic object),
library(grid) u = unit(1,"npc") + unit(2,"mm") grid:::absolute.units(u) #error in usemethod("absolute.units") : # no applicable method 'absolute.units' applied object of class #"c('unit.arithmetic', 'unit')" remarkably, absolute.size works, though calls grid:::absolute.units,
grid::absolute.size(u) #[1] 1null+2mm how possible?
ok, browsing grid source code, found out method is defined,
grid:::absolute.units.unit.arithmetic(u) but it's not exported. absolute.size() knows it, because it's in package namespace, calling outside (e.g. gtable) fails.
Comments
Post a Comment