plot(0, 0, main = bquote(pi == .(pi)))
library(tinyplot)
plt(0, 0, main = bquote(pi == .(pi))) # "TRUE"
plt(0, 0, main = bquote(foo == .(pi)))
## Error in draw_title(main, sub, cap, xlab, ylab, legend, legend_args, opar, :
## object 'foo' not found
A workaround is to explicitly convert the call to an expression:
plt(0, 0, main = as.expression(bquote(foo == .(pi))))
Relevant ?plotmath fragment:
In most cases other language objects (names and calls, including
formulas) are coerced to expressions and so can also be used.
A workaround is to explicitly convert the call to an expression:
Relevant
?plotmathfragment: