Skip to content
Prev 337160 / 398528 Next

do calculation within expression(), text in plot

Use bquote() and its .() operator, as in
  with(mtcars, {
      plot(wt, mpg)
      text(4, 30, bquote(r[Pearson] ~ "=" ~ .(cor(wt, mpg))))
  })

Bill Dunlap
TIBCO Software
wdunlap tibco.com