【发布时间】:2018-11-23 08:03:55
【问题描述】:
我们可以使用以下方法在 R 中的绘图标题中使用下标或上标
plot(1,1, main=expression('title'^2)) #superscript
plot(1,1, main=expression('title'[2])) #subscript
但是,如果我想在表达式中使用字符串变量怎么办。例如,
my_string="'title'^2"
plot(1,1, main=expression(my_string))
显然,这不起作用,情节标题只是变成 my_string 而不是 title^2。
是否可以在表达式中使用字符串变量?
谢谢, 布里杰。
【问题讨论】:
标签: r expression subscript superscript