unitType {imageUtilities} | R Documentation |
returns the type of the given unit.
unitType(unit, default.units = "pixels")
unit |
the input unit to get the type of |
default.units |
what to return of the input has no unit type |
the unit: either a grid unit type or default.units
as a string.
Other units: convertScreenUnits
,
getPPI
, getScreenResolution
library(grid) unitType( unit(1,'inches') ) # 'inches' unitType( unit(.5,'npc') ) # 'npc' unitType( 1234 ) # 'pixels' unitType( 1234, default.units='fdsa' ) # 'fdsa'