[R] do calculation within expression(), text in plot
tonja.krueger at web.de
Fri Feb 28 11:26:58 CET 2014
I would like to add some text to my plot, containing a variable and the
calculated value for the variable.
As I would like to produce many plots, I hope this can be done
Unfortunately I can't get R to do the calculation for cor(nou,dak) when I
text(0,2.2,expression(paste(r[Pearson],"=", cor(nou,dak) , sep= " ")),pos=4,
Is there a command that "stops" expression() so the result is calculated and
printed in the plot?
Thank you in advance,
More information about the R-help