Skip to content
Prev 152249 / 398500 Next

Greek characters in plots

OK, I am definitely struggling here.

The text I am trying to plot isn't a mathematical expression, it's:

A) ?stbA::cat 

This is biological notation for a particular mutation.  The "A)" part is a tag identifying the graph, and the "stbA::cat" bit is the gene that is mutated.  Both the tag and gene are set as variables in a loop, and only the delta remains the same.

As the text I am trying to plot isn't a mathematical expression, I seem to be having trouble getting substitute() and expression() to do what I want.  As plotmath states "A mathematical expression must obey the normal rules of syntax for any R expression", I fear I may be barking up the wrong tree!

Thank you all for your help so far, but can someone please help me once more and tell me how I can get the capital Delta symbol so I can use it in non-mathematical text and strings for plotting?

Thanks once again

Mick  

-----Original Message-----
From: Prof Brian Ripley [mailto:ripley at stats.ox.ac.uk] 
Sent: 05 August 2008 12:40
To: michael watson (IAH-C)
Cc: Henrique Dallazuanna; r-help at r-project.org
Subject: Re: [R] Greek characters in plots
On Tue, 5 Aug 2008, michael watson (IAH-C) wrote:

            
?plotmath says

       'Alpha' - 'Omega'               uppercase Greek symbols

How could that be made clearer?

(Note it carefully says Greek *symbols* not *character*: they are not the
same thing.)
Use substitute?  E.g.

substitute(expression(foo*Delta), list(foo=3))

(Some people prefer bquote, but that is just a wrapper for substitute in 
R.)