[R] measure displayed size of a character string

Terry J. Westley twestley at buffalo.veridian.com
Tue Jun 22 01:37:49 CEST 1999


Is there a way to measure the length of a character string as
text() or mtext() would display it?  Not in characters, but in
inches or user coordinates.

I'm displaying a hierarchical list in the left margin.  I'd like
to determine the length of the labels so that I can resize the
plot so the labels don't spill over into the plot area.

Like this:
                    +------------------
   Earth            |
    |               |
    +-Africa        |
    |   |           |
    |   +-Nigeria   |
    |               |
    +-Europe        |
        |           |
        +-France    |
                    +------------------
--
Terry J. Westley, Principal Engineer
Veridian Engineering, Calspan Operations
twestley at buffalo.veridian.com   http://www.veridian.com/
-------------------------------------------------------
Author of TASH, an Ada binding to Tcl/Tk.
Visit the TASH web site at http://tash.calspan.com.
-------------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list