如何在数学表达式中添加星号? [英] How to add an asterisk symbol in a mathematical expression?
本文介绍了如何在数学表达式中添加星号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图用 R² 值和显着性编码来注释一个图,但我不能将 *
作为符号传递,而不是作为并列运算符传递.
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.
我试过 ?plot.math
,这是我试过的
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^{**"
推荐答案
你需要在你的表达式中使用paste
:
You need to use paste
inside your expression:
text(4,6,expression(paste(R^2==8^"**")))
或
text(6,4,expression(paste(R^2==8, "**")))
这篇关于如何在数学表达式中添加星号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文