I want to add the following title to a ggplot:
"Number of times where UK emissions of Sulphur Dioxide exceeded 10 microgrammes per metre cubed"
The components of this title come from:
free text = "Number of times where UK emissions of "
input$select = Sulphur Dioxide (or any other pollutant the user selects)
free text = "exceeded "
input$number = 10 (or any other integer the user selects)
formula = μg/m3 (where the 3 is superscript of m)
Have used a combination of paste and expression and bquote, but its just not coming out right.
Here's my code for the above....
ggplot() +
aes(x=year, y=cnt) +
labs(title = paste("Number of times where UK emissions of ", input$select,
" exceeded", input$number, expression(mu), "g/m", "^{3}"))