Re: [R] forest + igraph ?

From: Viechtbauer Wolfgang (STAT) <>
Date: Tue, 12 Apr 2011 10:12:04 +0200

It is not clear (at least to me) what exactly you want. You want two forest plots "in one graph" but apparently not side-by-side or one on top and the other on the bottom. So, you want to superimpose them? How do you want to do that without creating an illegible mess? Or do you want one graph, where you can scroll through various plots? Then try this:


if (interactive()) {

   dat <- escalc(measure="RR", ai=tpos, bi=tneg, ci=cpos, di=cneg,    forest(dat$yi, dat$vi)
   dat <- escalc(measure="OR", ai=tpos, bi=tneg, ci=cpos, di=cneg,    forest(dat$yi, dat$vi)

and then use PageUp and PageDown to switch between the figures.

(I don't know what OS you are using, so windows() may not work).


Wolfgang Viechtbauer 
Department of Psychiatry and Neuropsychology 
School for Mental Health and Neuroscience 
Maastricht University, P.O. Box 616 
6200 MD Maastricht, The Netherlands 
Tel: +31 (43) 368-5248 
Fax: +31 (43) 368-8689 

> -----Original Message-----
> From: []
> On Behalf Of Samor Gandhi
> Sent: Monday, April 11, 2011 18:25
> To:
> Subject: [R] forest + igraph ?
> Hello,
> Is it possible to have two meta-plots in one graph (not par(mfrow=c(2,1))?
> But somthing like
>  library(metafor)
>  library("igraph")
>  if (interactive()) {
>     forest(dat.Treat$RR,$lower, ci.ub=dat.Treat$upper,
> xlab="Relative Risk",slab=dat.Treat$ID,refline=1)
>     forest(dat.Control$RR,$lower,
> ci.ub=dat.Control$upper, xlab="Relative
> Risk",slab=dat.Control$ID,refline=1)
>   }
> i.e. both metaplots on the same graph!
> Regards,
> Samor
______________________________________________ mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code.
Received on Tue 12 Apr 2011 - 08:17:10 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 12 Apr 2011 - 08:50:28 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive