[R] plotting Formulas with greek letters and variable values (expression, substitute, paste, ...)

Gabor Grothendieck ggrothendieck at gmail.com
Sun Jan 17 19:18:07 CET 2010


Try bquote:

a <- 0.1; b <- 0.2
plot(0, main = bquote(tau(A) == .(a)*lg(A^.(b))))


On Sun, Jan 17, 2010 at 12:47 PM, rrookie1982 <desser1 at uni-bonn.de> wrote:
>
> Hallo together,
>
> I want to write a formula of the type
>
> http://n4.nabble.com/file/n1016112/expression.gif
>
>
>
>
>
>
>
> into my plot, where the values 1.234 and -0.567 should origin from variables
> in the program. The threads in this forum gave me some ideas that the
> functions expression(), paste(), and substitute() will get me there but I
> just cannot figure out how to do it. The closest I got is:
>
> text(0,7.5,substitute(expression(paste(symbol("t"),"(A) = ",c1 +
> lg(A^c2),sep="")),list(c1=0,456,c2=-0.123)),pos=4)
>
> Thankful for any suggestions!
> Daniel
> --
> View this message in context: http://n4.nabble.com/plotting-Formulas-with-greek-letters-and-variable-values-expression-substitute-paste-tp1016112p1016112.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> 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.
>



More information about the R-help mailing list