Hi all,
I have an R Markdown document that I've been rendering to Word as part of a weekly report for a few years now. I just updated packages and now a ggtitle
with some inline HTML styling is rendering as plain text.
Here is a simpler example of what I am trying to do:
(EDIT to add that I had been using ggtext
also)
library(tidyverse)
library(ggtext)
a_number <- 1024
ggplot(mtcars, aes(mpg, wt, colour = cyl)) +
geom_point() +
theme(plot.title = element_markdown()) +
ggtitle(paste0("This is my red number: ",
"<span style=color:'#e15759'>",
a_number,
"</span>."))
So what would be the current correct way to apply styling to individual parts within a ggtitle
?
> packageVersion('ggplot2')
[1] ‘3.4.0’
> packageVersion('ggtext')
[1] ‘0.1.2’