Dear all, I would like to create a math-type label like this one: c(expression(theta[1]), expression(theta[2]), ..., expression(theta[N])) How can I do that in an automatic way (i.e., for any dimension N). I tried with a "for" loop, but also need to used substitute I guess. Any idea? Thanks a lot, David
math-type label
2 messages · Ardia David, Uwe Ligges
Ardia David wrote:
Dear all, I would like to create a math-type label like this one: c(expression(theta[1]), expression(theta[2]), ..., expression(theta[N]))
Example:
plot(1:10, xaxt="n")
here <- 1:10
axis(1, at = here,
do.call("expression",
lapply(here, function(j)
substitute(theta[i], list(i=j)))))
Uwe Ligges
How can I do that in an automatic way (i.e., for any dimension N). I tried with a "for" loop, but also need to used substitute I guess. Any idea? Thanks a lot, David
______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.