[R] How to get % and subscript in plotmath

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Sep 5 10:58:16 CEST 2001


Peter Baker <peter.baker at cmis.csiro.au> writes:

> Hi
> 
> I seem to have a problem getting both a subscript and a % symbol on a label
> 
> ylab=expression(S/S[MSY] (* plain(%) * )) or
> ylab=expression(S/S[MSY] (%) )
>                                 and many variants  gives a syntax error
> ylab=paste(expression(S/S[MSY]), "(%)", sep="")
>                                 yields the % symbol but no subscripts
> 
> If I leave out the %, I get the subscript OK
> 
> Advice greatly appreciated

The first thing to check with this stuff is that you have a valid R
expression. The first two are not valid since for one thing a % by
itself is not possible in R syntax - also, a "*" immediately after a
left parenthesis is surely wrong. The third one results from pasting
an expression and a character string, which gives a character string,
and no math plotting.

Did you mean

expression(S/S[MSY] * "%")


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list