[R] Greek symbols in study labels and custom summary lines in forest plot (meta)

Rapsomaniki, Eleni e.rapsomaniki at ucl.ac.uk
Mon Jul 29 20:52:37 CEST 2013


Dear R helpers,

Is there a way to display mathematical notations (e.g. greek characters, subscripts) properly in study (studlab) and group (byvar) labels in a forest plot created using the meta package?

#Example:
library(meta)
logHR <- log(runif(10,0.5,2))
selogHR <- log(runif(10,0.05,0.2))
study=c(0.1,.2,.3,.4,.5,0.1,.2,.3,.4,.5)
group=c(rep('alpha',5),rep('beta',5))
meta1=metagen(logHR, selogHR, sm="HR",studlab=paste("Fixed",expression(beta[w]),study),byvar=group)
forest(meta1, print.byvar=F)

Question 2
Is there a way to add a line to this plot at my preferred location? For example, I want to add a within-group combined estimate line (the default here is just an overall group line by random or fixed effects). 
I know I need to use grid.lines, e.g.

grid.lines(x = 3, y = c(0.5,1),gp = gpar(col = 5))

But for the life of me I can't work out the co-ordinate system in grid graphics!

Thank you for ANY help or tips! I've run out of things to try :(

Eleni

Eleni Rapsomaniki
Research Associate/Statistics, PhD
Clinical Epidemiology Group
Department of Epidemiology and Public Health 
University College London Medical School







More information about the R-help mailing list