units                  package:base                  R Documentation

_G_r_a_p_h_i_c_a_l _U_n_i_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     `xinch' and `yinch' convert the specified number of inches given
     as their arguments into the correct units for plotting with
     graphics functions.  Usually, this only makes sense when normal
     coordinates are used, i.e., no `log' scale (see the `log' argument
     to `par').

     `xyinch' does the same for a pair of numbers `xy', simultaneously.

     `cm' translates inches in to cm (centimeters).

_U_s_a_g_e:

     xinch(x = 1, warn.log = TRUE)
     yinch(y = 1, warn.log = TRUE)
     xyinch(xy = 1, warn.log = TRUE)
     cm(x)

_A_r_g_u_m_e_n_t_s:

     x,y: numeric vector

      xy: numeric of length 1 or 2.

warn.log: logical; if `TRUE', a warning is printed in case of active
          log scale.

_E_x_a_m_p_l_e_s:

     all(c(xinch(),yinch()) == xyinch()) # TRUE
     xyinch()
     xyinch #- to see that is really   delta{"usr"} / "pin"

     cm(1)# = 2.54

     ## plot labels offset 0.12 inches to the right
     ## of plotted symbols in a plot
     data(mtcars)
     attach(mtcars)
     plot(mpg, disp, pch=19, main= "Motor Trend Cars")
     text(mpg + xinch(0.12), disp, rownames(mtcars),adj=0, cex = .7, col='blue')
     detach(mtcars)

