R-beta: Including an evaluated function in text expression

Matthew R. Nelson (mrn@superh.hg.med.umich.edu)
Fri, 27 Mar 1998 14:05:53 -0500 (EST)


Date: Fri, 27 Mar 1998 14:05:53 -0500 (EST)
From: "Matthew R. Nelson" <mrn@superh.hg.med.umich.edu>
Subject: R-beta: Including an evaluated function in text expression
To: r-help@stat.math.ethz.ch
Message-Id: <Pine.3.87.9803271310.A18041-0100000@superh.hg.med.umich.edu>

R-users,

I would like to take advantage of R's mathematical typesetting 
capabilities in the graphical environment using text(..., 
expression(...)), however, I can't figure out how to include in the 
expression some evaluated function.  For example,

> x <- 1:8
> plot(1:10, 1:10)
> text(5, 5, expression(sum(x[i], i == 1, length(x)))  # would like "8" 
                                        # substituted for length(x) here

Is there a way to replace length(x) with the returned value of the 
function?

Thanks for any advice,

Matt
----------------------------------------------------------------------------
Matthew R. Nelson
Dept. of Human Genetics         
University of Michigan              http://www-personal.umich.edu/~ticul/
4711 Medical Science II             email: ticul@umich.edu
Ann Arbor, MI  48109-0618           phone: (313) 647-3151
----------------------------------------------------------------------------




-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._