<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1455808501776_6799"><span id="yui_3_16_0_1_1455808501776_6819">Prezados colegas, este assunto me interessa, gostaria de saber como automatizar este gráfico, fiz um script, mas é todo manual, os gráficos de pareto dos pacotes não formatam por cor, seria possível visualizar os efeitos negativos e positivos em cores diferentes?</span></div><div id="yui_3_16_0_1_1455808501776_6799"><span><br></span></div><div id="yui_3_16_0_1_1455808501776_6799"><span>Att,</span></div><div></div><div> </div><div class="signature" id="yui_3_16_0_1_1455808501776_6749"><span style="font-weight:bold;font-style:italic;">Ari Clecius Alves de Lima</span><br style="font-weight:bold;font-style:italic;"><span style="font-weight:bold;font-style:italic;">Engenheiro Químico</span><br style="font-weight:bold;font-style:italic;"><span style="font-weight:bold;font-style:italic;">Me. Engenharia Civil<br></span><div id="yui_3_16_0_1_1455808501776_6748"><span style="font-style:italic;font-weight:bold;">Dr.</span> <span style="font-style:italic;font-weight:bold;">Engenharia Civil</span><br style="font-weight:bold;font-style:italic;"><span style="font-weight:bold;font-style:italic;">(085)84174333</span><br style="font-weight:bold;font-style:italic;"><span style="font-weight:bold;font-style:italic;" id="yui_3_16_0_1_1455808501776_6893">(085)33669042</span></div><div id="yui_3_16_0_1_1455808501776_6748"><span style="font-weight:bold;font-style:italic;"><br></span></div><div id="yui_3_16_0_1_1455808501776_6748"><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6904" class=""><i id="yui_3_16_0_1_1455808501776_6906" class="">#############3</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6909" class=""><i id="yui_3_16_0_1_1455808501776_6911" class="">#A=temperatura</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6914" class=""><i id="yui_3_16_0_1_1455808501776_6916" class="">#B=vibração</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6919" class=""><i id="yui_3_16_0_1_1455808501776_6921" class="">#A<-c(20,20,60,60,20,20,60,60,20,20,60,60)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6924" class=""><i id="yui_3_16_0_1_1455808501776_6926" class="">#B<-c(5,15,5,15,5,15,5,15,5,15,5,15)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6929" class=""><i id="yui_3_16_0_1_1455808501776_6931" class="">#y<-c(74,50,46,34,68,48,44,32,65,51,40,26)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6934" class=""><i id="yui_3_16_0_1_1455808501776_6936" class=""><br id="yui_3_16_0_1_1455808501776_6938" class=""></i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6941" class=""><i id="yui_3_16_0_1_1455808501776_6943" class="">A<-c(-1,-1,1,1,-1,-1,1,1,-1,-1,1,1)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6946" class=""><i id="yui_3_16_0_1_1455808501776_6948" class="">B<-c(-1,1,-1,1,-1,1,-1,1,-1,1,-1,1)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6951" class=""><i id="yui_3_16_0_1_1455808501776_6953" class="">y<-c(74,50,46,34,68,48,44,32,65,51,40,26)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6956" class=""><i id="yui_3_16_0_1_1455808501776_6958" class="">group<-c("A","B","C","D","A","B","C","D","A","B","C","D")</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6961" class=""><i id="yui_3_16_0_1_1455808501776_6963" class="">falha<-data.frame(A,B,y,group)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6966" class=""><i id="yui_3_16_0_1_1455808501776_6968" class="">aov.2=aov(y~A+B+A*B, data=falha)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6971" class=""><i id="yui_3_16_0_1_1455808501776_6973" class="">summary(aov.2)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6976" class=""><i id="yui_3_16_0_1_1455808501776_6978" class=""><br id="yui_3_16_0_1_1455808501776_6980" class=""></i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6983" class=""><i id="yui_3_16_0_1_1455808501776_6985" class=""><br id="yui_3_16_0_1_1455808501776_6987" class=""></i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6990" class=""><i id="yui_3_16_0_1_1455808501776_6992" class="">efeitos<-2*(aov.2$coef[2:4])</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_6995" class=""><i id="yui_3_16_0_1_1455808501776_6997" class=""><br id="yui_3_16_0_1_1455808501776_6999" class=""></i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7002" class=""><i id="yui_3_16_0_1_1455808501776_7004" class="">#Estimativa da variância do erro experimental (s^2)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7007" class=""><i id="yui_3_16_0_1_1455808501776_7009" class="">grau_L1<-2</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7012" class=""><i id="yui_3_16_0_1_1455808501776_7014" class="">grau_L2<-2</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7017" class=""><i id="yui_3_16_0_1_1455808501776_7019" class="">grau_L3<-2</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7022" class=""><i id="yui_3_16_0_1_1455808501776_7024" class="">grau_L4<-2</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7027" class=""><i id="yui_3_16_0_1_1455808501776_7029" class="">ag <- data.frame(aggregate(. ~ group, falha, function(x) c(mean = mean(x), sd = sd(x))))</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7032" class=""><i id="yui_3_16_0_1_1455808501776_7034" class="">s2<-(sum(2*(ag$y[,2])^2))/(grau_L1+grau_L2+grau_L3+grau_L4)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7037" class=""><i id="yui_3_16_0_1_1455808501776_7039" class=""><br id="yui_3_16_0_1_1455808501776_7041" class=""></i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7044" class=""><i id="yui_3_16_0_1_1455808501776_7046" class="">#syi^2=s2/n onde n é o número de replicatas(3)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7049" class=""><i id="yui_3_16_0_1_1455808501776_7051" class="">#sy1^2=sy2^2=sy3^2=sy4^2=syq</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7054" class=""><i id="yui_3_16_0_1_1455808501776_7056" class="">#sy=raiz(syq)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7059" class=""><i id="yui_3_16_0_1_1455808501776_7061" class="">n<-3</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7064" class=""><i id="yui_3_16_0_1_1455808501776_7066" class="">sy=sqrt(s2/n)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7069" class=""><i id="yui_3_16_0_1_1455808501776_7071" class=""><br id="yui_3_16_0_1_1455808501776_7073" class=""></i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7076" class=""><i id="yui_3_16_0_1_1455808501776_7078" class="">#t(ef)=ef/s(ef)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7081" class=""><i id="yui_3_16_0_1_1455808501776_7083" class="">tefA=efeitos[1]/sy</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7086" class=""><i id="yui_3_16_0_1_1455808501776_7088" class="">tefB=efeitos[2]/sy</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7091" class=""><i id="yui_3_16_0_1_1455808501776_7093" class="">tefAB=efeitos[3]/sy</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7096" class=""><i id="yui_3_16_0_1_1455808501776_7098" class=""><br id="yui_3_16_0_1_1455808501776_7100" class=""></i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7103" class=""><i id="yui_3_16_0_1_1455808501776_7105" class=""><br id="yui_3_16_0_1_1455808501776_7107" class=""></i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7110" class=""><i id="yui_3_16_0_1_1455808501776_7112" class="">#Gráfico de pareto</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7115" class=""><i id="yui_3_16_0_1_1455808501776_7117" class=""><br id="yui_3_16_0_1_1455808501776_7119" class=""></i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7122" class=""><i id="yui_3_16_0_1_1455808501776_7124" class="">f1<-c(tefA,tefB,tefAB);f1</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7127" class=""><i id="yui_3_16_0_1_1455808501776_7129" class="">z=data.frame(2*abs(f1))</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7132" class=""><i id="yui_3_16_0_1_1455808501776_7134" class="">z=t(z)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7137" class=""><i id="yui_3_16_0_1_1455808501776_7139" class="">v1=sy*(qt(0.975,8))</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7142" class=""><i id="yui_3_16_0_1_1455808501776_7144" class="">coef3=sort(z)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7147" class=""><i id="yui_3_16_0_1_1455808501776_7149" class="">coef3</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7152" class=""><i id="yui_3_16_0_1_1455808501776_7154" class=""><br id="yui_3_16_0_1_1455808501776_7156" class=""></i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7159" class=""><i id="yui_3_16_0_1_1455808501776_7161" class="">#png(file = "pareto_ceto.png",res=300, width = 4, height = 4, units = 'in')</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7164" class=""><i id="yui_3_16_0_1_1455808501776_7166" class="">g=barplot(sort(z),horiz=TRUE,names.arg=c( rev(names(f1))),col=ifelse(sort(abs(f1))>v1,"blue","gray"),xlim=c(0,25))##xlim, ylim</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7169" class=""><i id="yui_3_16_0_1_1455808501776_7171" class="">box("plot", col="blue")  </i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7174" class=""><i id="yui_3_16_0_1_1455808501776_7176" class="">abline(v=v1,col="red",lty=2)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7179" class=""><i id="yui_3_16_0_1_1455808501776_7181" class="">s=format(v1,digits=2)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7184" class=""><i id="yui_3_16_0_1_1455808501776_7186" class="">text(6,1,label=expression("S"[ef]*" x t"[crit]*"="),cex=1)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7189" class=""><i id="yui_3_16_0_1_1455808501776_7191" class="">text(9,1,label=s,cex=1)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7194" class=""><i id="yui_3_16_0_1_1455808501776_7196" class="">mtext("Gráfico de pareto dos efeitos", side=3, line=2, cex=1.0, col="blue", outer=FALSE)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7199" class=""><i id="yui_3_16_0_1_1455808501776_7201" class="">p=format(f1,scientific = TRUE)</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" class=""><b id="yui_3_16_0_1_1455808501776_7204" class=""><i id="yui_3_16_0_1_1455808501776_7206" class="">legend(x=16,y=2,cex=0.6,bg="yellow",box.col="blue", legend=c( "A=-22.3","B=-16.0","AB=3.33" ), col="blue", lwd=1:2, lty=c(NA,NA,NA))</i></b></div><div id="yui_3_16_0_1_1455808501776_6748" dir="ltr" class=""><b id="yui_3_16_0_1_1455808501776_7209" class=""><i id="yui_3_16_0_1_1455808501776_7211" class="">#dev.off()</i></b></div></div></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue-Light, Helvetica Neue Light, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> Em Quinta-feira, 18 de Fevereiro de 2016 10:18, Paulo Dick <paulopcdick@gmail.com> escreveu:<br></font></div>  <br><br> <div class="y_msg_container"><div id="yiv3307284933"><div><div dir="ltr">Bom dia Ana Paula,<div><br clear="none"></div><div>Seu gráfico não aparece para mim.</div><div><br clear="none"></div><div>Sugiro também que envie a sintaxe que utilizou.</div><div><br clear="none"></div><div>Abraço</div></div><div class="yiv3307284933gmail_extra"><br clear="all"><div><div class="yiv3307284933gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><b><br clear="none"></b></div><div dir="ltr"><b>Paulo Dick</b><div>Estatístico</div><div>Mestre em Epidemiologia em Saúde Pública</div><div>Tel.: (55 21) 99591-2716</div></div></div></div></div></div></div></div></div></div>
<br clear="none"><div class="yiv3307284933gmail_quote">Em 17 de fevereiro de 2016 21:59, ana paula coelho madeira <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:apcmadeira@hotmail.com" target="_blank" href="mailto:apcmadeira@hotmail.com">apcmadeira@hotmail.com</a>></span> escreveu:<br clear="none"><blockquote class="yiv3307284933gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">


<div class="yiv3307284933yqt6441245009" id="yiv3307284933yqt93625"><div><div dir="ltr">Prezados,<br clear="none"> <br clear="none">boa noite!<br clear="none"> <br clear="none">Construí um gráfico de Pareto utilizando a função paretoPlot e a saída é da forma:<br clear="none"><div style="display:inline-block;"><span> </span>    <div style="display:inline-block;"><img width="430" height="430"></div>    <span> </span></div> <br clear="none">Gostaria de fazer uma das seguintes alterações:<br clear="none"> <br clear="none">1) Apresentar as barras na horizontal; <br clear="none">ou<br clear="none">2) Colocar as estimativas na vertical ( para não ficar tão difícil de visualizar).<br clear="none"> <br clear="none">Desde já agradeço.<br clear="none"> <br clear="none">Att.,<span class="yiv3307284933HOEnZb"><font color="#888888"><br clear="none"> <br clear="none">Ana Paula <br clear="none">                                        </font></span></div></div></div>
<br clear="none">_______________________________________________<br clear="none">
R-br mailing list<br clear="none">
<a rel="nofollow" shape="rect" ymailto="mailto:R-br@listas.c3sl.ufpr.br" target="_blank" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br clear="none">
Leia o guia de postagem (<a rel="nofollow" shape="rect" target="_blank" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br clear="none"></blockquote></div><br clear="none"></div></div></div><br><div class="yqt6441245009" id="yqt33613">_______________________________________________<br clear="none">R-br mailing list<br clear="none"><a shape="rect" ymailto="mailto:R-br@listas.c3sl.ufpr.br" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br clear="none"><a shape="rect" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br clear="none">Leia o guia de postagem (<a shape="rect" href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forne� c�igo m�imo reproduz�el.</div><br><br></div>  </div> </div>  </div></div></body></html>