Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在R中的表达式和粘贴函数组合中包含引用_R - Fatal编程技术网

在R中的表达式和粘贴函数组合中包含引用

在R中的表达式和粘贴函数组合中包含引用,r,R,我想给我的绘图添加一个带有数学符号和数字参考的标签。我尝试了表达式函数和粘贴函数,但未能在绘图中包含我想要写的内容 以下是我的问题的简单版本: plot(NA,xlim = c(0, 5), ylim = c(0,5)) a = 5 在点(1,1)处,我想在绘图上添加一个标签γ=5。以下是我尝试过的: text(1,1,expression(paste(gamma, "=", a))) 但曲线图显示,γ=a。 我想知道如何在表达式和粘贴函数的组合中包含数字引用 谢谢大家! 中的选项包括sub

我想给我的绘图添加一个带有数学符号和数字参考的标签。我尝试了
表达式
函数和
粘贴
函数,但未能在绘图中包含我想要写的内容

以下是我的问题的简单版本:

plot(NA,xlim = c(0, 5), ylim = c(0,5))
a = 5
在点(1,1)处,我想在绘图上添加一个标签γ=5。以下是我尝试过的:

text(1,1,expression(paste(gamma, "=", a)))
但曲线图显示,γ=a。 我想知道如何在表达式和粘贴函数的组合中包含数字引用


谢谢大家!

中的选项包括
substitute
bquote
,例如,
text(1,1,bquote(gamma==(a))
它可以工作!!谢谢您!