On Thu, 17 Jan 2008, Johannes Graumann wrote: > Hi all, > > I asked something like this earlier but decided that a proper minimal > example might be helpfull ;0) > > Why does this work with regards to the expression (substitution): > > require(stats) > plot(cars) > text(5,120,labels=substitute(i^{z+phantom()}*"("*a*" > AMU)",list(i="yx",z=2,a=0))) > text(c(5,5),c(115,110),labels=c("One","Two")) > > But adding this (using a vector of expressions/substitutions) fails to print > the expression correctly: > > text(c(5,5),c(105,100),labels=c(substitute(i^{z+phantom()}*"("*a*" > AMU)",list(i="yx",z=2,a=0)),"Three")) > > This is a bug, no?
Yes, but not where you appear to think it is. 'labels' is not an expression: check it by typeof(). Using expression() in place of c() will give what I think you intended. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595 ______________________________________________ R-help@r-project.org 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.