Use semicolon within expression

Hello, I am a beginner in R. I want to write an expression with the semicolon symbol inside. I have a plot and I want the y-label to look like this: ylab=expression(f[T](t; a, ß))

How can I add the symbol ";" after the t without r interpreting it as a command?

Hi @Aimbot. You can just enclose it will "" as character will do.

Hi @Aimbot,

Will this work for you?

ggplot(data = data.frame(x = rnorm(10), y = rnorm(10)),
       aes(x = x, y = y)) +
  geom_point() +
  xlab(label = expression("[" * alpha * ";" * beta * "]"))

Hope it helps :slightly_smiling_face:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.