e-letter
2009-Oct-02 11:32 UTC
[R] plot subscript text and percentage symbol in graph label axis
Readers, I am unable to plot a label consisting of both subscript text and percentage (%) symbol: x<-(1:10) y<-(200:191) plot(x~y,ylab=expression(~degree~C),xlab=expression(x[2]~%)) Error: syntax error, unexpected ERROR in "plot(x~y,ylab=expression(~degree~C),xlab=expression(x~%)" It seems that % is a special character in R? I have looked in the introductory manual but can see no reference to reserved characters. Yours, rhelpatconference.jabber.org r251 mandriva2008
baptiste auguie
2009-Oct-02 12:10 UTC
[R] plot subscript text and percentage symbol in graph label axis
try this, plot(x~y,ylab=expression(~degree~C),xlab=expression(x[2]~"%")) baptiste 2009/10/2 e-letter <inpost at gmail.com>:> Readers, > > I am unable to plot a label consisting of both subscript text and > percentage (%) symbol: > > x<-(1:10) > y<-(200:191) > plot(x~y,ylab=expression(~degree~C),xlab=expression(x[2]~%)) > Error: syntax error, unexpected ERROR in > "plot(x~y,ylab=expression(~degree~C),xlab=expression(x~%)" > > It seems that % is a special character in R? I have looked in the > introductory manual but can see no reference to reserved characters. > > Yours, > > rhelpatconference.jabber.org > r251 > mandriva2008 > > ______________________________________________ > R-help at 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. >