<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.apple-style-span
        {mso-style-name:apple-style-span;}
span.apple-tab-span
        {mso-style-name:apple-tab-span;}
span.EstiloDeEmail19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=PT-BR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>brother<-vector()<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>for (i in 1:length(dados[,1])){<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                </span><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>if(nome[i]==nome1[i]) brother[i]<-"irmão"<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>                else brother[i]<-"amigos"<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>}<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>dados$brother<-brother<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Veja se ajuda!!!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> r-br-bounces@listas.c3sl.ufpr.br [mailto:r-br-bounces@listas.c3sl.ufpr.br] <b>Em nome de </b>Edson Lira<br><b>Enviada em:</b> segunda-feira, 6 de agosto de 2012 16:20<br><b>Para:</b> R-br Lista<br><b>Assunto:</b> [R-br] Ifelse para duas variáveis simultânemante<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal style='background:white'><span style='font-size:18.0pt;font-family:"Lucida Console";color:black'>Boa tarde, tenho dificuldades em programação, tenho essa rotina abaixo, quero chamar de irmão aqueles nomes que se repetem em nome e nome1, caso contrário quero chama-lo de amigos. Estou tentando usar o ifelse para testar para duas variáveis simultâneamente, não descobri qual o meu erro, alguém tem alguma sugestão?<o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:18.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:18.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p></div><div><div><p class=MsoNormal style='background:white'><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>nome</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'><-c(</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"joshua"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"jose"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"maria"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"maria"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"edinho"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"raimundo"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"raimundo"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"maria"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"jose"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>)</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>nome1</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'><-c(</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"jose"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"jose"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"maria"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"maria"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"edson"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"raimundo"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"raimundo"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"maria"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"jose"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>)</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>idade</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'><-c(</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#065118'>18</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#065118'>28</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#065118'>19</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#065118'>29</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#065118'>18</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#065118'>25</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#065118'>19</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#065118'>25</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#065118'>20</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>)</span></span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>dados</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'><-data.frame(</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>nome</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>nome1</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>idade</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>)</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='background:white'><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>dados</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>$</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>brother</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'><-ifelse(</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>dados</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>$</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>nome</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>=</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"jose"</span></span><span class=apple-style-span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>&</span></span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'><o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>                             </span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>ifelse(</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>dados</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>$</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>nome1</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>=</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"jose"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>   <span class=apple-tab-span>    </span>        <span class=apple-tab-span>     </span>            </span><span style='font-size:36.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"irmãos"</span><span style='font-size:36.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>,</span><span style='font-size:36.0pt;font-family:"Helvetica","sans-serif";color:#AF130B'>"amigo"</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:#0D2099'>))</span><span style='font-size:31.0pt;font-family:"Helvetica","sans-serif";color:black'>   <o:p></o:p></span></p></div></div><div><p class=MsoNormal style='background:white'><span style='font-size:18.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:18.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:18.0pt;font-family:"Lucida Console";color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:18.0pt;font-family:"Lucida Console";color:black'>[  ]'s.<o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:18.0pt;font-family:"Lucida Console";color:black'>Edson Lira<br>Estatístico<br>Manaus-Amazonas<o:p></o:p></span></p></div></div></div></body></html>