Dear R-users,

I am trying to use the grid.text and expression functions to display several character strings and plotmath text on a viewport. Some strings can include a variable portion (PI.limits in the following example), which I thought could be implemented by combining the bquote and the expression functions. Unfortunately, my expressions do not seem to be evaluated. I would greatly appreciate if somebody could tell me where my mistake(s) is(are).

Thank you in advance


###### 8< #######

library(grid)

PI.limits <- c(0.1,0.9)

vp.ref <- c("raw data","median","median",
                bquote(expression(paste(.(PI.limits[1]*100), " and ",
.(PI.limits[2]*100)^th," percentiles", sep=""))), bquote(expression(paste(95^th,"confidence interval on percentiles", sep=" "))), bquote(expression(paste(95^th,"confidence interval on percentiles", sep=" ")))
                )


grid.newpage()

for (i in c(1,3,4,5,6)) {
 grid.text(eval(vp.ref[i]), x=0.5, y=unit(1,"npc")-unit(i,"lines"))
}

______________________________________________
R-help@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.

Reply via email to