R Core Team
(R-core@R-project.org
) The R Project for Statistical Computing.

Lijia Yu
(yu@lijiayu.net / GitHub
/ Twitter) A master candidate majoring in Bioinformatics at Beijing Institute of Genomics.

Karl Broman
(kbroman@biostat.wisc.edu / GitHub
/ Twitter) Department of Biostatistics and Medical Informatics, University of Wisconsin-Madison; research in statistical genetics; developer of R/qtl (for R)

Kevin Ushey
(kevinushey@gmail.com / GitHub
/ Twitter) MSc., University of British Columbia; interested in statistical genetics and data visualization

Want to write mathematical symbols and expressions in R graphics? You can use an R expression()
instead of normal text, e.g. plot(1:10, main = expression(alpha + beta)). Below is a demo that
shows you everything about plotting math in R (it was written by the R Core Team; see ?plotmath
for details):

demo(plotmath)

Combining expressions and text

If you want to combine multiple mathematical expressions with text, use paste()insideexpression(), as in the following.

par(mar = c(4,4,2,0.1))
plot(rnorm(100), rnorm(100),
xlab = expression(hat(mu)[0]), ylab = expression(alpha^beta),
main = expression(paste("Plot of ", alpha^beta," versus ", hat(mu)[0])))

Finally, if we want to include variables from an R session in mathematical expressions, and
substitute in their actual values, we can use substitute().