<div dir="ltr"><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)">Olá Edson boa tarde,</div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)">meu caro, não sei se esssa é a melhor solução mas você poderia utilizar text(). Utilizei nos meus scripts e atendeu minhas expectativas:</div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)">a library da função pode ser encontrada neste link: <a href="http://stat.ethz.ch/R-manual/R-devel/library/graphics/html/text.html">http://stat.ethz.ch/R-manual/R-devel/library/graphics/html/text.html</a></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)"><br></div><div class="gmail_default" style="font-family:'arial narrow',sans-serif;color:rgb(11,83,148)">abraços </div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-23 17:48 GMT-03:00 Edson Lira <span dir="ltr"><<a href="mailto:edinhoestat@yahoo.com.br" target="_blank">edinhoestat@yahoo.com.br</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:times new roman,new york,times,serif;font-size:16px"><div dir="ltr"><span>Meus caros amigos, estou tentando usar um exemplo de aplicação de MCA, script abaixo: </span></div><div dir="ltr"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)">#Usando MCA</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># load packages</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas"><span style="color:#061a99">require(</span>FactoMineR<span style="color:#061a99">)</span></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">require(<span style="color:#000000">ggplot2</span>)</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># load data tea</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">data(<span style="color:#000000">tea</span>)</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas">tea</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">names(<span style="color:#000000">tea</span>)</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># select these columns</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(176,22,0)"><span style="color:#000000">newtea</span><span style="color:#061a99"> = </span><span style="color:#000000">tea</span><span style="color:#061a99">[, c(</span>"Tea"<span style="color:#061a99">, </span>"How"<span style="color:#061a99">, </span>"how"<span style="color:#061a99">, </span>"sugar"<span style="color:#061a99">, </span>"where"<span style="color:#061a99">, </span>"always"<span style="color:#061a99">)]</span></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># take a peek</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">head(<span style="color:#000000">newtea</span>)</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">names(<span style="color:#000000">newtea</span>)</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas"><span style="color:#061a99">str(</span>newtea<span style="color:#061a99">)</span></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)"><span style="color:#000000">cats</span> = apply(<span style="color:#000000">newtea</span>, <span style="color:#045218">2</span>, <span style="color:#c38809">function</span>(<span style="color:#000000">x</span>) nlevels(as.factor(<span style="color:#000000">x</span>)))</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas">cats</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># apply MCA</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas">mca1<span style="color:#061a99"> = MCA(</span>newtea<span style="color:#061a99">, </span>graph<span style="color:#061a99"> = </span><span style="color:#c38809">FALSE</span><span style="color:#061a99">)</span></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># list of results</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas">mca1</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># table of eigenvalues</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas">mca1<span style="color:#061a99">$</span>eig</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)">#We can use the package "ggplot2()" to get a nice plot:</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># data frame with variable coordinates</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas">mca1_vars_df<span style="color:#061a99"> = data.frame(</span>mca1<span style="color:#061a99">$</span>var<span style="color:#061a99">$</span>coord<span style="color:#061a99">, </span>Variable<span style="color:#061a99"> = rep(names(</span>cats<span style="color:#061a99">), </span>cats<span style="color:#061a99">))</span></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># data frame with observation coordinates</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas">mca1_obs_df<span style="color:#061a99"> = data.frame(</span>mca1<span style="color:#061a99">$</span>ind<span style="color:#061a99">$</span>coord<span style="color:#061a99">)</span></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas"><span style="color:#061a99">par(</span>cex.axis<span style="color:#061a99">=</span><span style="color:#045218">0.5</span><span style="color:#061a99">)</span></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># plot of variable categories</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas"><span style="color:#061a99">ggplot(</span>data<span style="color:#061a99">=</span>mca1_vars_df<span style="color:#061a99">,</span>cex.axis<span style="color:#061a99">=</span><span style="color:#045218">0.5</span><span style="color:#061a99">, </span>cex.lab<span style="color:#061a99">=</span><span style="color:#045218">0.5</span><span style="color:#061a99">,</span></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">       aes(<span style="color:#000000">x</span> = <span style="color:#000000">Dim.1</span>, <span style="color:#000000">y</span> = <span style="color:#000000">Dim.2</span>, <span style="color:#000000">label</span> = rownames(<span style="color:#000000">mca1_vars_df</span>))) +</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)"> geom_hline(<span style="color:#000000">yintercept</span> = <span style="color:#045218">0</span>, <span style="color:#000000">colour</span> = <span style="color:#b01600">"gray70"</span>) +</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)"> geom_vline(<span style="color:#000000">xintercept</span> = <span style="color:#045218">0</span>, <span style="color:#000000">colour</span> = <span style="color:#b01600">"gray70"</span>) +</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)"> geom_text(aes(<span style="color:#000000">colour</span>=<span style="color:#000000">Variable</span>)) +</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(176,22,0)"><span style="color:#061a99"> ggtitle(</span>"MCA plot of variables using R package FactoMineR"<span style="color:#061a99">)</span></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(79,79,79)"># MCA plot of observations and categories</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">ggplot(<span style="color:#000000">data</span> = <span style="color:#000000">mca1_obs_df</span>, aes(<span style="color:#000000">x</span> = <span style="color:#000000">Dim.1</span>, <span style="color:#000000">y</span> = <span style="color:#000000">Dim.2</span>)) +</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">  geom_hline(<span style="color:#000000">yintercept</span> = <span style="color:#045218">0</span>, <span style="color:#000000">colour</span> = <span style="color:#b01600">"gray70"</span>) +</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">  geom_vline(<span style="color:#000000">xintercept</span> = <span style="color:#045218">0</span>, <span style="color:#000000">colour</span> = <span style="color:#b01600">"gray70"</span>) +</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">  geom_point(<span style="color:#000000">colour</span> = <span style="color:#b01600">"gray50"</span>, <span style="color:#000000">alpha</span> = <span style="color:#045218">0.7</span>) +</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">  geom_density2d(<span style="color:#000000">colour</span> = <span style="color:#b01600">"gray80"</span>) +</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">  geom_text(<span style="color:#000000">data</span> = <span style="color:#000000">mca1_vars_df</span>, </div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">            aes(<span style="color:#000000">x</span> = <span style="color:#000000">Dim.1</span>, <span style="color:#000000">y</span> = <span style="color:#000000">Dim.2</span>, </div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">                <span style="color:#000000">label</span> = rownames(<span style="color:#000000">mca1_vars_df</span>), <span style="color:#000000">colour</span> = <span style="color:#000000">Variable</span>)) +</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(176,22,0)"><span style="color:#061a99">  ggtitle(</span>"MCA plot of variables using R package FactoMineR"<span style="color:#061a99">) +</span></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)">  scale_colour_discrete(<span style="color:#000000">name</span> = <span style="color:#b01600">"Variable"</span>)</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153)" dir="ltr">Como faço para mudar o tamanho da fonte do título, dos eixos, legenda, etc.? Tentei os comandos cex, cex.axis, cex.lab, mas não consegui. </div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px" dir="ltr">Alguém tem alguma sugestão?</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div dir="ltr">


























































</div><div style="margin-top:0px;margin-bottom:0px;margin-left:4px;font-size:15px;font-family:Consolas;color:rgb(6,26,153);min-height:18px"><br></div><div></div><div> [  ]'s.</div><span class="HOEnZb"><font color="#888888"><div><div>Edson Lira<br>Estatístico<br>Manaus-Amazonas</div></div></font></span></div></div><br>_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
<a 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>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div style="text-align:center"><font color="#0c343d" face="arial narrow, sans-serif">Att,</font></div><div style="text-align:center"><font color="#0c343d" face="arial narrow, sans-serif"><br></font></div><div style="text-align:center"><font color="#0c343d" face="arial narrow, sans-serif">Fernando Gama da Mata</font></div><div style="text-align:center"><font color="#0c343d" face="arial narrow, sans-serif"><br></font></div><div style="text-align:center"><font color="#0c343d" face="arial narrow, sans-serif" size="1"><img src="http://territoriopress.com.br/wp-content/uploads/2013/12/images.png" width="96" height="60"></font></div><div style="text-align:center"><font color="#0c343d" face="arial narrow, sans-serif">Vale of Institute Technology</font></div></div></div></div></div></div></div>
</div>