[R] Plotmath expression

From: Christos Hatzis <christos_at_nuverabio.com>
Date: Tue 24 Oct 2006 - 16:08:25 GMT


I've been trying to plot a subscript in a text formula using plotmath but I haven't been able to do so.  

In my example below I would like the text label to show X[min] = 10.1 +/- 5.5

Here is the code:

ll <- c(x=10.1, sde=5.5)
text(x=9, y=2, pos=2, expression(paste(X[min], "=", paste(ll, collapse="+/-"))))

This works fine up to the inner paste call that collapses the vector values. I also tried assigning the value of the inner paste to a variable and then use it inside the expression but that did not work either:

ll.txt <- paste(ll, collapse="+/-")
text(x=9, y=2, pos=2, expression(paste(X[min], "=", ll.txt)))

Any help is much appreciated.


Christos Hatzis, Ph.D.
Nuvera Biosciences, Inc.
400 West Cummings Park
Suite 5350
Woburn, MA 01801
Tel: 781-938-3830

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Wed Oct 25 02:16:38 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Wed 25 Oct 2006 - 01:30:16 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.