Learn R Programming

pophelper (version 2.2.9)

unitConverter: Internal: Convert value between dimension units

Description

Internal: Convert value between dimension units

Usage

unitConverter(value = NA, fromunit = NA, tounit = NA, dpi = NA)

Arguments

value

A numeric value or numeric vector to convert

fromunit

A character indicating the current unit of the value. Options are "cm", "mm", "in" or "px".

tounit

A character indicating the unit to change to. Options are "cm", "mm", "in" or "px".

dpi

A numeric indicating the resolution for pixel conversion. This should be in PPI (pixels per inch).

Value

Returns a numeric value or numeric vector in changed units.