italic(vs) inside subtitle as part of user function

Solution 1:

Edit: the expression solution was not giving the right solution, this works.

dt <- data.frame(x <- 1:5, y <- 3:7)

varA <- "FOO"
varB <- "BOO"

ggplot(dt, aes(x, y)) + geom_point() +
  labs(subtitle = substitute(
    ~varA ~italic(vs) ~varB,
    list(varA = varA, varB = varB, vs = "vs")
  )
)

enter image description here