この場合、plotmath は式の呼び出しのリストを強制できません。
> cs <- c(bquote(theta == .(a)),bquote(theta == .(a)))
> cs
[[1]]
theta == 123
[[2]]
theta == 123
> sapply(cs, class)
[1] "call" "call"
自分で式を強制すると、これを機能させることができます。
> c(as.expression(bquote(theta == .(a))), as.expression(bquote(theta == .(a))))
expression(theta == 123, theta == 123)
> plot(1,1)
> legend('bottomleft',legend= c(as.expression(bquote(theta == .(a))),
+ as.expression(bquote(theta == .(a)))))
もう 1 つの方法は、次を使用して式の呼び出しの元のリストを強制することsapply
です。
plot(1,1)
legend("bottomleft",
sapply(c(bquote(theta == .(a)), bquote(theta == .(a))), as.expression))