如何连接两个表达式?
How to concatenate two expressions?
如何组合两个表达式(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 似乎是相关的,但我发现它对这个特定问题没有帮助。
...找到了答案(感谢之前被删除的post):
expr <- bquote(bgroup("(",frac(1,3)*", "*frac(1,2),")"))
plot(0, 0, xlab = bquote(alpha~"is in "~.(expr)), ylab = "")
如何组合两个表达式(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 似乎是相关的,但我发现它对这个特定问题没有帮助。
...找到了答案(感谢之前被删除的post):
expr <- bquote(bgroup("(",frac(1,3)*", "*frac(1,2),")"))
plot(0, 0, xlab = bquote(alpha~"is in "~.(expr)), ylab = "")