unitType {imageUtilities}R Documentation

returns the type of the given unit.

Description

returns the type of the given unit.

Usage

  unitType(unit, default.units = "pixels")

Arguments

unit

the input unit to get the type of

default.units

what to return of the input has no unit type

Value

the unit: either a grid unit type or default.units as a string.

See Also

Other units: convertScreenUnits, getPPI, getScreenResolution

Examples

library(grid)
unitType( unit(1,'inches') )           # 'inches'
unitType( unit(.5,'npc') )             # 'npc'
unitType( 1234 )                       # 'pixels'
unitType( 1234, default.units='fdsa' ) # 'fdsa'

[Package imageUtilities version 1.0.3 Index]