[R-br] Ajuda para criar um grafico

Leonard de Assis assis.leonard em gmail.com
Quinta Outubro 25 00:09:23 BRST 2012


Andre,

vi a pouco na lista do ggplot2 um script que pode ser o que voce procura.

# d is a data frame with 4 columns
# d$x gives variable names
# d$y gives center point
# d$ylo gives lower limits
# d$yhi gives upper limits
forestplot <- function(d, xlab="Odds Ratio", ylab="Study"){
  require(ggplot2)
  p <- ggplot(d, aes(x=x, y=y, ymin=ylo, ymax=yhi)) +
    geom_pointrange() +
    coord_flip() +
    geom_hline(aes(x=0), lty=2) +
    ylab(xlab) +
    xlab(ylab) #switch because of the coord_flip() above
  return(p)
}

# Create some dummy data.
d <- data.frame(x = toupper(letters[1:10]),
                y = rnorm(10, .05, 0.1))
d <- transform(d, ylo = y-1/10, yhi=y+1/10)

forestplot(d)

[]s
Leonard de Assis
assis <dot> leonard <at> gmail <dot> com

Em 24/10/2012 23:55, andrebvs escreveu:
> Olá Humberto!
>  
> Eu até começei a fazer o que estava querendo, porém, não consegui
> implementar os intervalos de confianças com as respectivas médias.
> Segue um script abaixo até onde cheguei, se alguém puder continuar e
> sanar sua dúvida, seria uma grande ajuda!
>
> library(fields)
> plot(xlim=c(0,1.8),5:10, bty='n',type="n",axes=F,xlab="Relative
> catchability",ylab="")
> x <- seq(0.0,1.8,by=0.2)
> y <- seq(5,14)
> u <- 1
> v <- 50
>
> axis(1,lwd=2,at = x,labels = formatC(x, format="fg"))
> abline(v = 1, col = "black",lty=1,lwd=2)
> arrow.plot(x[6],y[6],v,u,arrow.ex=.4, length=.2, col='black', lwd=2)
> arrow.plot(x[6],y[6],u-360,v-45,arrow.ex=.5, length=.2, col='black',
> lwd=2)
>
> text(0,7,"Bigeye\nYellowfin tuna\nAlbacore\nSwordfish\nSailfish\nWhite
> marlim\nBlue marlim\nBlue shark\nCrocodile shark\nPelagic
> stingray\nTurtle oliva\nOceanic whitetip shark",cex = 0.8,adj=c(0,0))
>
> text(1.1,5,"Species\nBigeye tuna\nYellowfin
> tuna\nAlbacore\nSwordfish\nSailfish\nWhite marlim\nBlue marlim\nBlue
> shark\nCrocodile shark\nPelagic stingray\nTurtle oliva\nOceanic
> whitetip shark",cex = 0.8,adj=c(0,0))
>
>
> /Att./
> /André Barbosa Ventura da Silva/
>  
>  
> ------------------------------------------------------------------------
> Em 24/10/2012 20:38, *Ivan Bezerra Allaman < ivanalaman em yahoo.com.br
> >* escreveu:
> Utilize as funções plot, segments e par para obter êxito! O link
> abaixo será útil também.
>  
> http://gallery.r-enthusiasts.com/
>  
> (S,f,P)
> Allaman
>  
> * *
> \begin{signature}
> <<>>=
> Prof. Dr. Ivan Bezerra Allaman
> Universidade Estadual de Santa Cruz
> Departamento de Ciências Exatas e Tecnológicas
> Ilhéus/BA - Brasil
> Fone: +55 73 3680-5596
> E-mail: ivanalaman em yahoo.com.br/ivanalaman em gmail.com
> @
> \end{signature}
>  
>
>
> _______________________________________________
> R-br mailing list
> R-br em listas.c3sl.ufpr.br
> https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
> Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo reproduzível.

-------------- Próxima Parte ----------
Um anexo em HTML foi limpo...
URL: <http://listas.inf.ufpr.br/pipermail/r-br/attachments/20121025/e8eeac96/attachment.html>


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