RE: [R] Math Expression and Variable Value in Title

2004-01-29 Thread Henrik Bengtsson
anuari 2004 01:35 > To: Wolfgang Viechtbauer > Cc: [EMAIL PROTECTED] > Subject: Re: [R] Math Expression and Variable Value in Title > > > Use substitute() > > n <- 20 > plot(0, 0, main = substitute(paste(n[i], " = ", k), list(k = n))) > > -roger &g

Re: [R] Math Expression and Variable Value in Title

2004-01-29 Thread Prof Brian Ripley
Note that this will circumvent all the careful work in R to align the plotmath text correctly. In your case that includes having space for the subscript. It may not matter for main titles, but it certainly does for ylab or axis annotation or People might be producing PDF or Windows metaf

Re: [R] Math Expression and Variable Value in Title

2004-01-29 Thread Salvatore Barbaro
An alternative but also higly recommendable way is the use of the psfrag-package in your LaTeX-file. It is furthermore very simple in use. Type plot(1:10, main="test") in your LaTeX-file you insert in your figure-environment the command \psfrag{test}{$n_i=20$} before you call the \includegraphi

Re: [R] Math Expression and Variable Value in Title

2004-01-29 Thread Martin Maechler
> "Roger" == Roger D Peng <[EMAIL PROTECTED]> > on Wed, 28 Jan 2004 19:35:28 -0500 writes: Roger> Use substitute() Yes! Roger> n <- 20 Roger> plot(0, 0, main = substitute(paste(n[i], " = ", k), list(k = n))) but even better is plot(0, 0, main = substitute(n[i]

Re: [R] Math Expression and Variable Value in Title

2004-01-28 Thread Roger D. Peng
Use substitute() n <- 20 plot(0, 0, main = substitute(paste(n[i], " = ", k), list(k = n))) -roger Wolfgang Viechtbauer wrote: Hello All, I am trying to put a math expression into a plot title and at the same time, I want a value in the title to depend on a variable that I set earlier. Simple Ex

[R] Math Expression and Variable Value in Title

2004-01-28 Thread Wolfgang Viechtbauer
Hello All, I am trying to put a math expression into a plot title and at the same time, I want a value in the title to depend on a variable that I set earlier. Simple Example: n <- 20 plot(0, 0) title(expression(paste(n[i], " = ", n))) Obviously, I want "n_i = 20". How can I get that? Thanks i