<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span><br></span></div><div></div><div>Olá, Walmes</div><div><br></div><div>Eu ainda tenho esse código e, coincidentemente, o apresentei hoje aos meus alunos.</div><div><br></div><div>Segue o código em questão:</div><div><br></div><div><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">#----------------------------------------------------------------</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">core=function(nome="Meu amor")</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">{</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69);
 font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  x=seq(-2,2,0.001)</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  y1=sqrt(1-((abs(x)-1)^2))</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  y2=-3*sqrt(1-(sqrt(abs(x))/sqrt(2)))</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  plot(main="Enfim, achei uma fórmula pra explicar", ylab="</span><a rel="nofollow" target="_blank" href="http://www.profmsouza.blogspot.com/" style="color: rgb(30, 102, 174); outline: 0px; line-height: 15.859375px;
 font-family: Verdana;">www.profmsouza.blogspot.com</a><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">",xlab="o que sinto por você...",sub=nome,c(x,x),c(y1,y2),lwd=3,pch=20,cex=6)</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  grid()</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  cores=paste(c("red","tomato"),sort(rep(1:4,2)),sep="")</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  eq=c("( AM + BC ) * X = AM ( X + BOC ) - BCTE","AMX + BCX = AMX + AMBOC - BCTE","BCX = AMX - AMX + BC (AMO - TE)","BCX = BC ( AMO - TE
 )","X = ???")</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  pos=c(-0.3,-0.6,-0.9,-1.2,-1.5)</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  cont=0</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  for (i in 1:30)</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  {</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height:
 15.859375px;">    points(c(x,x),c(y1,y2),col=cores[sample(1:8,1)],lwd=sample(1:4,1),pch=20,cex=round(runif(1,1,4)))</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">    if (i%%5 == 0 & i <=25)</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">    {</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">      cont=cont+1</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height:
 15.859375px;">      text(0,pos[cont],eq[cont])</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">    }</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  }</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">  text(1.2,-2.5,"AMO-TE",col="red",cex=3)</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color: rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">}</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"><span style="color:
 rgb(69, 69, 69); font-family: Georgia; line-height: 15.859375px;">core()</span><br style="line-height: 15.859375px; color: rgb(69, 69, 69); font-family: Georgia;"></div><div><br></div><div><br></div><div>Um abraço</div><div>- - - - - - - - - - - - - - - - - - -</div>  <div>Cleber Nascimento do Carmo, Dr.</div><pre style="font-family: 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 12px; margin-top: 0px; margin-bottom: 0px; padding: 0px; word-wrap: break-word; white-space: pre-wrap !important;">Professor Adjunto de Bioestatística e Estatística
Universidade Federal do Rio de Janeiro
Campus Macaé - www.macae.ufrj.br
E-mail: cleber@im.ufrj.br / clebercarmo@macae.ufrj.br
skype: cleber_carmo</pre><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><br></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; background-color: transparent; font-style: normal;"><br></div>  <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">De:</span></b> walmes . <walmeszeviani@gmail.com><br>
 <b><span style="font-weight: bold;">Para:</span></b> r-br@listas.c3sl.ufpr.br <br> <b><span style="font-weight: bold;">Enviadas:</span></b> Terça-feira, 11 de Junho de 2013 17:30<br> <b><span style="font-weight: bold;">Assunto:</span></b> [R-br] [OFF-TOPIC] código R para plotar um coração com animação<br> </font> </div> <div class="y_msg_container"><br><div id="yiv4801561744"><font face="trebuchet ms,sans-serif">Saudações pessoal,<br><br>Alguém tem cópia daquele código R, uma vez compartilhado na lista, acho que na época do R-STAT ainda.<br></font><font face="trebuchet ms,sans-serif"><font face="trebuchet ms,sans-serif">O código que falo é aquele que tem um laço for(), as cores mudam com a execução.<br>
</font>Dou aula sobre funções hoje e quinta e queria motivar os alunos à presentear suas respectivas com um CMR amoroso.<br>Ou provocar logo a separação dependendo do senso de humor e diferença de nerdismo do casal.<br>Versões simples eu encontrei em:<br>
<a rel="nofollow" target="_blank" href="http://stackoverflow.com/questions/8082429/plot-a-heart-in-r">http://stackoverflow.com/questions/8082429/plot-a-heart-in-r</a><br><a rel="nofollow" target="_blank" href="http://blog.revolutionanalytics.com/2013/02/make-a-valentines-heart-with-r.html">http://blog.revolutionanalytics.com/2013/02/make-a-valentines-heart-with-r.html</a><br>
<a rel="nofollow" target="_blank" href="http://rud.is/b/2013/02/14/happy-valentines-day-mrshrbrmstr/">http://rud.is/b/2013/02/14/happy-valentines-day-mrshrbrmstr/</a><br><br>Grato.<br>Walmes.<br><br clear="all"></font><div><span style="font-family: 'trebuchet ms', sans-serif;">==========================================================================</span><br style="font-family: 'trebuchet ms', sans-serif;">
<span style="font-family: 'trebuchet ms', sans-serif;">Walmes Marques Zeviani</span><br style="font-family: 'trebuchet ms', sans-serif;"><span style="font-family: 'trebuchet ms', sans-serif;">LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)</span><br style="font-family: 'trebuchet ms', sans-serif;">
<span style="font-family: 'trebuchet ms', sans-serif;">Departamento de Estatística - Universidade Federal do Paraná</span><br style="font-family: 'trebuchet ms', sans-serif;"><span style="font-family: 'trebuchet ms', sans-serif;">fone: (+55) 41 3361 3573</span><br style="font-family: 'trebuchet ms', sans-serif;">
<span style="font-family: 'trebuchet ms', sans-serif;">VoIP: (3361 3600) 1053 1173</span><br style="font-family: 'trebuchet ms', sans-serif;"><span style="font-family: 'trebuchet ms', sans-serif;">e-mail: <a rel="nofollow" ymailto="mailto:walmes@ufpr.br" target="_blank" href="mailto:walmes@ufpr.br">walmes@ufpr.br</a><br>
skype: walmeszeviani<br style="font-family: 'trebuchet ms', sans-serif;"></span><span style="font-family: 'trebuchet ms', sans-serif;">twitter: @walmeszeviani</span><br style="font-family: 'trebuchet ms', sans-serif;"><span style="font-family: 'trebuchet ms', sans-serif;">homepage: <a rel="nofollow" target="_blank" href="http://www.leg.ufpr.br/~walmes">http://www.leg.ufpr.br/~walmes</a></span><br style="font-family: 'trebuchet ms', sans-serif;">
<span style="font-family: 'trebuchet ms', sans-serif;">linux user number: 531218</span><br style="font-family: 'trebuchet ms', sans-serif;"><span style="font-family: 'trebuchet ms', sans-serif;">==========================================================================</span></div>
</div><br>_______________________________________________<br>R-br mailing list<br><a ymailto="mailto:R-br@listas.c3sl.ufpr.br" 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><br></div> </div> </div>  </div></body></html>