You do not need a character vector, but the expression, therefore, is
expression(R^2 == 0.85)
- that's what you need. In this case, you want to replace the result of another R-operation. For this you want substitute() or bquote() . I find the latter easier to work with:
rsquarelm2 <- 0.855463 plot(1:10, 1:10, type = "n") text(5, 5, bquote(R^2 == .(round(rsquarelm2, 2))))
With bquote() everything in .( ) bquote() evaluated, and the result is included in the returned expression.
source share