Re: [R] How to plot an expression-label with variable text (lattice variant)

2010-08-28 Thread Dieter Menne
For the record: lattice behaves slightly differently, it requires an as.expression with bquote. Dieter plotExp - function(what) { plot.new() lab = bquote(Estimated~t[50]~ from ~.(what) ) ; text(0.5,0.2,lab) } plotExp(tgv) library(lattice) plotLattice - function(what) { lab =

[R] How to plot an expression-label with variable text

2010-08-27 Thread Dieter Menne
Disclaimer: I have read plotmath, but maybe it's too late today: How do I get the two labels to be the same: plot.new() lab =expression(paste(Estimated , t[50], from tgv)) text(0.5,0.5,lab) # Should look the same as above. I could not get the substitute right: what = tgv lab

Re: [R] How to plot an expression-label with variable text

2010-08-27 Thread baptiste auguie
hi, try this lab =bquote(paste(Estimated , t[50], from ,.(what))) HTH, baptiste On 27 August 2010 20:19, Dieter Menne dieter.me...@menne-biomed.de wrote: plot.new() lab =expression(paste(Estimated , t[50], from tgv)) text(0.5,0.5,lab) # Should look the same as above. I could not get the

Re: [R] How to plot an expression-label with variable text

2010-08-27 Thread David Winsemius
On Aug 27, 2010, at 2:19 PM, Dieter Menne wrote: Disclaimer: I have read plotmath, but maybe it's too late today: How do I get the two labels to be the same: plot.new() lab =expression(paste(Estimated , t[50], from tgv)) text(0.5,0.5,lab) # Should look the same as above. I could not get the

Re: [R] How to plot an expression-label with variable text

2010-08-27 Thread Dieter Menne
Thanks to both of you. I noted that my example was over-simplified. Looks like I need to correct the environment when nested in a function, but I have to catch the last bus now. Dieter plotExp = function(what) { plot.new() lab =expression(paste(Estimated , t[50], from tgv))

Re: [R] How to plot an expression-label with variable text

2010-08-27 Thread David Winsemius
On Aug 27, 2010, at 2:28 PM, baptiste auguie wrote: hi, try this lab =bquote(paste(Estimated , t[50], from ,.(what))) bquote doesn't need the paste() if you use plotmath separators: lab =bquote(Estimated ~t[50]~from~.(what)) text(0.5,0.2,lab) HTH, baptiste On 27 August 2010 20:19,

Re: [R] How to plot an expression-label with variable text

2010-08-27 Thread David Winsemius
On Aug 27, 2010, at 2:51 PM, Dieter Menne wrote: Thanks to both of you. I noted that my example was over-simplified. Looks like I need to correct the environment when nested in a function, but I have to catch the last bus now. Dieter plotExp = function(what) { plot.new() lab