[R] Greek letters in plots
Barry Rowlingson
B.Rowlingson at lancaster.ac.uk
Tue Nov 1 14:49:44 CET 2005
Johanna Hardin wrote:
>
> * paste("rho=", cor2[i])
> will produce a label of "rho=0.74", or whatever. But if I use
> 'substitute' or 'evaluate' commands in order to get a real Greek letter,
> I lose the ability to paste it with a data value.
Use parse() to turn that text into an expression. And use '==':
> rho=0.78
> plot(1:10,main=parse(text=paste("rho == ",rho)))
Not sure where your label is going, but the same thing should work for
axes and text labels.
Baz
More information about the R-help
mailing list