How to add an asterisk symbol in a mathematical expression?

北战南征 提交于 2019-12-03 16:56:31

问题


I'm trying to annotate a plot with R² value and significance coding, but I can't pass * as a symbol and not as the juxtaposition operator.

I've tried ?plot.math, here is what I tried

plot(1:10,1:10)
text(6,4,expression(R^2==8))
text(6,4,expression(R^2==8^{**}))
Error: unexpected '^' in "text(6,4,expression(R^2==8^{**"

回答1:


You need to use paste inside your expression:

text(4,6,expression(paste(R^2==8^"**")))

or

text(6,4,expression(paste(R^2==8, "**")))



来源:https://stackoverflow.com/questions/14871706/how-to-add-an-asterisk-symbol-in-a-mathematical-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!