[R-br] 2 graficos do grid lado a lado na mesma janela

Éder Comunello comunello.eder em gmail.com
Quarta Abril 15 11:57:19 BRT 2015


Pedro, bom dia!

Eu não tenho domínio desses pacotes, mas dei uma olhada e consegui alguma
coisa... Acredito que você possa melhorar a partir dos comandos abaixo.
Caso consiga, peço que poste a solução! Pra remover as bordas é só comentar
grid.rect().

### <code r>
if (!require("meta")) {install.packages("meta", dep=T); require("meta")}

b <- structure(list(ID2 = c("Lorca M-1992", "Carvalho MR-1993",
"Hamerschlak N-1997","Oeleman WMR-1998",
                                "Cabalero ZC-2007", "Otani MM-2009", "Otani
MM-2009", "Remesar MC-2009",
                                "Anes N-2010", "Flores Chaves M-2010"),
                        VP = c(77, 224, 20, 515, 68, 167, 167, 340, 19,
66),
                        VN = c(98, 182, 36, 481, 225, 257, 261, 1097, 15,
132),
                        with = c(82, 224, 20, 539, 69, 168, 168, 356, 23,
66),
                        without = c(98, 191, 40, 486, 238, 262, 262, 1099,
15, 157),
                        group = c("ABBOTT-ABBOTT CHAGAS ELISA",
"ABBOTT-ABBOTT CHAGAS ELISA",
                                  "ABBOTT-ABBOTT CHAGAS ELISA",
"ABBOTT-ABBOTT CHAGAS ELISA",
                                  "BIOSCHILE-TEST ELISA CHAGAS",
"ABBOTT-ABBOTT CHAGAS ELISA",
                                  "BIOSCHILE-TEST ELISA CHAGAS",
"BIOSCHILE-TEST ELISA CHAGAS",
                                  "BIOSCHILE-TEST ELISA CHAGAS",
"BIOSCHILE-TEST ELISA CHAGAS")),
                   .Names = c("ID2","VP", "VN", "with", "without",
"group"),
                   row.names = c(50L, 42L,69L, 60L, 37L, 113L, 111L, 124L,
97L, 102L), class = "data.frame")

b$Q47="ELISA"

m.e.se <- metaprop(VP, with, studlab=ID2
,data=b,subset=Q47=="ELISA",incr=.1,allincr=T,addincr=T,comb.fixed=F,hakn=T,title="ELISA
for Chagas disease",complab='With Chagas',outclab="True
positives",byvar=group,bylab='Trademark-name',print.byvar=T)

m.e.sp <- metaprop(VN, without, studlab=ID2
,data=b,subset=Q47=="ELISA",incr=.1,allincr=T,addincr=T,comb.fixed=F,hakn=T,title="ELISA
for Chagas disease",complab='With Chagas',outclab="True
negatives",byvar=group,bylab='Trademark-name',print.byvar=T)



require(grid)
grid.newpage)()
grid.show.layout(grid.layout(nrow = 1, ncol = 2, widths=unit(c(27,17),
"cm"), heights=unit(18, "cm")))
vp0 <- viewport(layout=grid.layout(nrow = 1, ncol = 2,
widths=unit(c(27,17), "cm"), heights=unit(18, "cm")))

pushViewport(vp0)
grid.rect()
grid.text(paste("texto", collapse="-"))

pushViewport(viewport(layout.pos.col=1, layout.pos.row=1), clip="off")
grid.rect()
forest(new=F, m.e.se,overall=F,text.random="D&L random
effects",pooled.events=T,xlab="Sensitivity",rightcols=F,leftcols=c("studlab",
"event", "n","effect",
"ci"),leftlabs=c("Study","TP","With","Sensitivity","95%-CI"))
popViewport(1)

pushViewport(viewport(layout.pos.col=2, layout.pos.row=1))
grid.rect()
forest(new=F,m.e.sp,overall=F,text.random="D&L random
effects",pooled.events=T,xlab="Specificity",rightcols=c("effect",
"ci"),leftcols=c("n","event"),leftlabs=c("TN","Without"),rightlabs=c("Specificity","95%-CI"))
popViewport(1)

### </code>

[image: Imagem inline 2]
-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20150415/5d0fc4e2/attachment.html>
-------------- Próxima Parte ----------
Um anexo não-texto foi limpo...
Nome: image.png
Tipo: image/png
Tamanho: 66339 bytes
Descrição: não disponível
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20150415/5d0fc4e2/attachment.png>


Mais detalhes sobre a lista de discussão R-br