Skip to content
Prev 207448 / 398506 Next

Paste expression in graph title

Have a look at the help page for ?plotmath, and try also this:

x <- rnorm(10)
y <- rnorm(10)
R2 <- round(summary(lm(y ~ x))$r.squared, 3)
plot(x, y, main = bquote(R^2 == .(R2)))


I hope it helps.

Best,
Dimitris
Paul Chatfield wrote: