Latex and variables in plot label in R?

前端 未结 4 1200
盖世英雄少女心
盖世英雄少女心 2021-02-15 04:20

How do I use variables in Latex expressions in R?

For example:

plot(X, Y, main=expression(R^2))

Will put R with a nice superscripted 2

4条回答
  •  一个人的身影
    2021-02-15 05:06

    Well this works...

    call(':', quote(R^2), a)
    

    though it feels a little hacky to me since it's using R's : operator, whereas you just want to stick some text on the end. Maybe there's a better way?

提交回复
热议问题