如何将两个表达式(expr
和alpha~"is in "
)组合在一起,以便将它们显示为一个表达式(在图形标签中或通过mtext()
或类似的表达式)?
expr <- expression(bgroup("(",frac(1,3)*", "*frac(1,2),")"))
plot(0, 0, xlab = expression(c(alpha~"is in ", expr)), ylab = "")
This似乎是相关的,但我发现它对这个特定问题没有帮助。
答案 0 :(得分:3)
...找到了答案(由于先前的帖子已被删除):
expr <- bquote(bgroup("(",frac(1,3)*", "*frac(1,2),")"))
plot(0, 0, xlab = bquote(alpha~"is in "~.(expr)), ylab = "")