I know how to get my result if I use one long expression:
expression(paste(M[O[2]], " (mg ", O[2], " ", h^-1, " ", kg^-1, ")"))
But I tried to break this in chunks, so that the user could select a time and a mass unit (to add flexibility), and then put together the complete expression. Say I just reuse the time and mass units from above but into 3 chunks, which I then try to join again:
a = expression(paste(M[O[2]], " (mg ", O[2]))
b = expression(kg^-1)
c = expression(h^-1)
I have tried
text(x, y, expression(a b c))
text(x, y, paste(a, b, c))
text(x, y, expression(paste(a, b, c)))
but this results in a, b and c remaining characters a, b and c, not the expressions created above. I have tried playing with bquote but I admit to not mastering it and I could not get it to concatenate the 3 plotmath expressions either.
Any suggestion?
Thanks,
Denis