3

在 R 和 grid 包中,有没有办法提取单元的单元类型?

例如:

x <- unit(1,'inches')

有没有这样的功能:

unittype(x) # returns 'inches'

(嗯,我确定有 - 但它是什么?)

干杯。

4

1 回答 1

2

我倾向于使用attr(x,"unit"),但老实说,我不确定是否有更简洁的功能。

于 2012-02-21T01:59:19.363 回答