I would like to get a latex symbol for beta with index 2.
The following code:
idx <- 2; ylab(eval(expression(paste("beta[",idx,"]",sep=""))))
creates the label "beta [2]" instead of "\ beta_ {2}". What am I doing wrong?
Note: to see what I want, just use ylab(expression(beta[2])) , but I want to infer the value from the idx variable instead of using a hard-coded value.
source share