In R, I want to create a graph with an x-axis label expression(varname), where varnameis the symbol object. For instance:
varname <- "beta[1]"
hist(rnorm(20),xlab=expression(varname))
But it gives me a schedule with xlab="varname", and not xlab=expression(beta[1]). How to convince to expression()evaluate a variable?
source
share