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

Popular posts from this blog

python - jinja2: TemplateSyntaxError: expected token ',', got 'string' -

node.js - NodeJS remote terminal to Dropbear OpenWRT-Server -

Qt4: how to send QString inside a struct via QSharedMemory -