A quick comment. paste() is not needed here; you can get "=" using '==' as follows
substitute(n[i]==k, list=list(k=n)) Cheers Henrik > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Roger D. Peng > Sent: den 29 januari 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 > > 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 Example: > > > > n <- 20 > > plot(0, 0) > > title(expression(paste(n[i], " = ", n))) > > > > Obviously, I want "n_i = 20". How can I get that? > > > > Thanks in advance, > > > > ______________________________________________ > [EMAIL PROTECTED] mailing list > https://www.stat.math.ethz.ch/mailma> n/listinfo/r-help > PLEASE > do read the posting guide! > http://www.R-project.org/posting-guide.html > > ______________________________________________ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
