Skip to content
Prev 207449 / 398506 Next

Paste expression in graph title

Try bquote:

set.seed(123)
x<-rnorm(10)
y<-rnorm(10)

R2 <- summary(lm(y ~ x))$r.squared
R2round <- round(R2, digits = 3)

plot(x, y, main = bquote(R^2 == .(R2round)))


On Mon, Jan 25, 2010 at 7:06 AM, Paul Chatfield
<p.s.chatfield at reading.ac.uk> wrote: