Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 R 和 grid 包中,有没有办法提取单元的单元类型?
例如:
x <- unit(1,'inches')
有没有这样的功能:
unittype(x) # returns 'inches'
(嗯,我确定有 - 但它是什么?)
干杯。
我倾向于使用attr(x,"unit"),但老实说,我不确定是否有更简洁的功能。
attr(x,"unit")