I am using barplot in R and need the title to follow APA format. I need to write 'Figure 1' in bold, then include an empty line, then write the title in italics, and it all needs to be left aligned. So, the title needs to read like this:
Figure 1
Reasons for Stops Compared
The best solution I have come up with so far is using the title() and expression() functions. However, when I do this, the second line (title) becomes indented and no matter what I try I cannot get the right combination of formatting to work without introducing a new problem. See example
here is example code to use
par(mar = c(5,4,5,1))
barplot(c(1, 1, 1), beside = T, col = 'black',
names.arg = c("Investigatory", "Safety", "Checkpoint"),
ylab = "Proportions", xlab = "Black / White")
title(main = expression(bold("Figure 1\n\n")~italic("Reasons for Stops Compared")), line = 1, adj = 0)
abline(h = c(1))