用文本和多个下标绘制 CI 的 R 表达式

R expression to plot CI with text and multiple subscripts

我在使用复杂下标的 R 中编写特定表达式时遇到问题。表达式应如下所示:$(A_{1,2,L}, A_{1,2,U})$

我有一个表达式可以生成正确的下标(下面的示例),但我无法在条目之间添加逗号。我需要使用 substitute() 还是 group()

plot(NULL, xlim = c(0, 2), ylim = c(0,2))
text(x = 1, y = 1, label = expression((A["1,2,L"]~A["1,2,U"])))

Output of example without comma

您需要将这两个表达式放在一个列表中list(expr1, expr2)

plot(NULL, xlim = c(0, 2), ylim = c(0,2))

text(x = 1, y = 1, label = expression((list(A["1, 2, L"] , A["1, 2, U"]))))