Search code examples
rplotplotmath

Exponent in a plotmath expression


I would like to have the following, for example in a ggplot2 label:

ylab(expression((hat(beta)^(2))(x)))

but without the parentheses around the hat(beta)^(2). But if I remove the parentheses, then the (x) goes up to the exponent.

Is there grouping in these expressions? Or invisible parentheses?


Solution

  • Is this what you would like?

    ylab(expression(hat(beta)^(2)*(x)))