Guenther, Cameron wrote: > Hi all, > I have a question about expression. > > In a figure I want to include the term D*obs with the star as as > superscript and obs as subscript. I have even just tried to get the > star to be superscript. > > > The code I tried was > text(Dstar+7,120,expression(paste({}D,^*))), but that doesn't work and I > get a syntax error. > > I can't seem to find anything in the help files that explains it. > Well, ?plotmath does say
A mathematical expression must obey the normal rules of syntax for any R expression, but it is interpreted according to very different rules than for normal R expressions. which should at least explain why you get a syntax error from the above code. Beyond that, you do need to understand how R's syntax rules work, including at least a feel for how expressions are represented internally, and how that influences the plotting of expressions. The easiest solution is probably expression(D^"*") ______________________________________________ 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.