<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Muito obrigado Rodrigo Coster!<br>
    <br>
    <br>
    Funcionou.<br>
    <br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">Em 26-04-2014 12:03, Rodrigo Coster
      escreveu:<br>
    </div>
    <blockquote
cite="mid:CAKU4wot_8g-NPeQpGFri2yAS3E0X5K4G+ykiQN3MYLTusddfiQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Tenta usar o %in% para reduzir os ifelse() (Não sei
        se é o caso, mas a função SE() do excel tem limite
        encadeiamentos, pode ser o caso aqui também)... Ex:
        <div><br>
        </div>
        <div>Todos esses ifelse()'s:</div>
        <div><br>
        </div>
        <div><span style="font-family:arial,sans-serif;font-size:13px">ifelse((origin=="am")
            & (destination=="ro"),1,ifelse((</span><span
            style="font-family:arial,sans-serif;font-size:13px">origin=="am")
            & (destination=="rr"),1,ifelse((</span><span
            style="font-family:arial,sans-serif;font-size:13px">origin=="am")
            & (destination=="pa"),1,ifelse((</span><span
            style="font-family:arial,sans-serif;font-size:13px">origin=="am")
            & (destination=="mt"),1</span><br>
        </div>
        <div><span style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px">Podem
            ser substituido por:</span></div>
        <div><span style="font-family:arial,sans-serif;font-size:13px"><br>
          </span></div>
        <div><font face="arial, sans-serif">ifelse(origin=="am" &
            destination %in% c("ro", "rr", "pa", "mt"),1, ifelse(...))</font><br>
        </div>
        <div><font face="arial, sans-serif"><br>
          </font></div>
        <div><font face="arial, sans-serif">E ainda assim acho que não é
            o mais adequado... Dependendo de como estão os teus dados,
            eu usaria um merge() para resolver o problema</font></div>
        <div><font face="arial, sans-serif"><br>
          </font></div>
        <div><font face="arial, sans-serif"><br>
          </font></div>
        <div><font face="arial, sans-serif">[]'s</font></div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2014-04-25 20:17 GMT-03:00 Alexandre
          Loures <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:alexandre.loures@ymail.com" target="_blank">alexandre.loures@ymail.com</a>></span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div bgcolor="#FFFFFF" text="#000000"> Boa noite!<br>
              <br>
              <br>
              Estou usando a rotina abaixo para construir uma dummy para
              as fronteiras dos estados brasileiros. Porém, quando tendo
              rodar o R reporta o seguinte erro:<br>
              <br>
              Erro: estouro da pilha de contexto na linha 18<br>
              <br>
              <br>
              O que devo fazer?<br>
              <br>
              <br>
              mydata$contiguity<-ifelse((origin=="ac") &
              (destination=="am"),1,<br>
              ifelse((origin=="am") &
              (destination=="ro"),1,ifelse((origin=="am") &
              (destination=="rr"),1,ifelse((origin=="am") &
              (destination=="pa"),1,ifelse((origin=="am") &
              (destination=="mt"),1,<br>
              ifelse((origin=="ro") &
              (destination=="mt"),1,ifelse((origin=="ro") &
              (destination=="am"),1,<br>
              ifelse((origin=="rr") &
              (destination=="am"),1,ifelse((origin=="rr") &
              (destination=="pa"),1,<br>
              ifelse((origin=="pa") &
              (destination=="mt"),1,ifelse((origin=="pa") &
              (destination=="am"),1,ifelse((origin=="pa") &
              (destination=="am"),1,ifelse((origin=="pa") &
              (destination=="rr"),1,<br>
              ifelse((origin=="pa") &
              (destination=="ap"),1,ifelse((origin=="pa") &
              (destination=="ma"),1,ifelse((origin=="pa") &
              (destination=="to"),1,ifelse((origin=="pa") &
              (destination=="mt"),1,<br>
              ifelse((origin=="ap") & (destination=="pa"),1,<br>
              ifelse((origin=="ma") &
              (destination=="pa"),1,ifelse((origin=="ma") &
              (destination=="to"),1,ifelse((origin=="ma") &
              (destination=="pi"),1,<br>
              ifelse((origin=="pi") &
              (destination=="ma"),1,ifelse((origin=="pi") &
              (destination=="to"),1,ifelse((origin=="pi") &
              (destination=="pe"),1,ifelse((origin=="pi") &
              (destination=="ce"),1,<br>
              ifelse((origin=="ce") &
              (destination=="pi"),1,ifelse((origin=="ce") &
              (destination=="pe"),1,ifelse((origin=="ce") &
              (destination=="pb"),1,ifelse((origin=="ce") &
              (destination=="rn"),1,<br>
              ifelse((origin=="rn") &
              (destination=="ce"),1,ifelse((origin=="rn") &
              (destination=="pb"),1,<br>
              ifelse((origin=="pb") &
              (destination=="rn"),1,ifelse((origin=="pb") &
              (destination=="ce"),1,ifelse((origin=="pb") &
              (destination=="pe"),1,<br>
              ifelse((origin=="pe") &
              (destination=="pb"),1,ifelse((origin=="pe") &
              (destination=="ce"),1,ifelse((origin=="pe") &
              (destination=="pi"),1,ifelse((origin=="pe") &
              (destination=="ba"),1,<br>
              ifelse((origin=="pe") & (destination=="al"),1,<br>
              ifelse((origin=="al") &
              (destination=="pe"),1,ifelse((origin=="al") &
              (destination=="ba"),1,ifelse((origin=="al") &
              (destination=="se"),1,<br>
              ifelse((origin=="se") &
              (destination=="al"),1,ifelse((origin=="se") &
              (destination=="ba"),1,<br>
              ifelse((origin=="ba") &
              (destination=="se"),1,ifelse((origin=="ba") &
              (destination=="al"),1,ifelse((origin=="ba") &
              (destination=="pe"),1,ifelse((origin=="ba") &
              (destination=="pi"),1,<br>
              ifelse((origin=="ba") &
              (destination=="to"),1,ifelse((origin=="ba") &
              (destination=="go"),1,ifelse((origin=="ba") &
              (destination=="mg"),1,ifelse((origin=="ba") &
              (destination=="es"),1,<br>
              ifelse((origin=="to") &
              (destination=="pa"),1,ifelse((origin=="to") &
              (destination=="mt"),1,ifelse((origin=="to") &
              (destination=="go"),1,ifelse((origin=="to") &
              (destination=="ba"),1,<br>
              ifelse((origin=="to") &
              (destination=="pi"),1,ifelse((origin=="to") &
              (destination=="ma"),1,<br>
              ifelse((origin=="mt") &
              (destination=="ro"),1,ifelse((origin=="mt") &
              (destination=="am"),1,ifelse((origin=="mt") &
              (destination=="pa"),1,ifelse((origin=="mt") &
              (destination=="to"),1,<br>
              ifelse((origin=="mt") &
              (destination=="go"),1,ifelse((origin=="mt") &
              (destination=="ms"),1,<br>
              ifelse((origin=="ms") &
              (destination=="mt"),1,ifelse((origin=="ms") &
              (destination=="go"),1,ifelse((origin=="ms") &
              (destination=="mg"),1,ifelse((origin=="ms") &
              (destination=="sp"),1,<br>
              ifelse((origin=="ms") & (destination=="pr"),1,<br>
              ifelse((origin=="go") &
              (destination=="mg"),1,ifelse((origin=="go") &
              (destination=="ba"),1,ifelse((origin=="go") &
              (destination=="to"),1,ifelse((origin=="go") &
              (destination=="mt"),1,<br>
              ifelse((origin=="go") &
              (destination=="ms"),1,ifelse((origin=="go") &
              (destination=="df"),1,<br>
              ifelse((origin=="mg") &
              (destination=="sp"),1,ifelse((origin=="mg") &
              (destination=="rj"),1,ifelse((origin=="mg") &
              (destination=="es"),1,ifelse((origin=="mg") &
              (destination=="ba"),1,<br>
              ifelse((origin=="mg") &
              (destination=="go"),1,ifelse((origin=="mg") &
              (destination=="ms"),1,<br>
              ifelse((origin=="sp") &
              (destination=="rj"),1,ifelse((origin=="sp") &
              (destination=="mg"),1,ifelse((origin=="sp") &
              (destination=="ms"),1,ifelse((origin=="sp") &
              (destination=="pr"),1,<br>
              ifelse((origin=="rj") &
              (destination=="mg"),1,ifelse((origin=="rj") &
              (destination=="mg"),1,ifelse((origin=="rj") &
              (destination=="es"),1,<br>
              ifelse((origin=="es") &
              (destination=="ba"),1,ifelse((origin=="es") &
              (destination=="mg"),1,ifelse((origin=="es") &
              (destination=="rj"),1,<br>
              ifelse((origin=="pr") &
              (destination=="sp"),1,ifelse((origin=="pr") &
              (destintaion=="sc"),1,ifelse((origin=="pr") &
              (destination=="ms"),1,<br>
              ifelse((origin=="sc") &
              (destination=="pr"),1,ifelse((origin=="sc") &
              (destination=="rs"),1,<br>
              ifelse((origin=="rs") & (destination=="sc"),1,<br>
              ifelse((origin=="df") &
(destination=="go"),1,0))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))<span
                class="HOEnZb"><font color="#888888"><br>
                  <br>
                  <br>
                  <br>
                  <div>-- <br>
                    <font size="1"><b>Alexandre Rodrigues Loures</b><br>
                    </font></div>
                </font></span></div>
            <br>
            _______________________________________________<br>
            R-br mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
            <a moz-do-not-send="true"
              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 moz-do-not-send="true"
              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>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
R-br mailing list
<a class="moz-txt-link-abbreviated" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a>
<a class="moz-txt-link-freetext" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a class="moz-txt-link-freetext" 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.</pre>
    </blockquote>
    <br>
    <div class="moz-signature">-- <br>
      <font size="1"><b>Alexandre Rodrigues Loures</b><br>
        Doutorando em Economia Aplicada<br>
        Universidade Federal da Paraíba - UFPB<br>
        Centro de Ciências Sociais Aplicadas - CCSA<br>
        Programa de Pós-Graduação em Economia - PPGE<br>
        Tel.: +55 32 9102-0690 (MG) ou +55 83 9804-1000 (PB)<br>
        e-Mail: <a class="moz-txt-link-abbreviated" href="mailto:alexandre.loures@ymail.com">alexandre.loures@ymail.com</a><br>
        Site: <a class="moz-txt-link-abbreviated" href="http://www.ccsa.ufpb.br/ppge">www.ccsa.ufpb.br/ppge</a></font></div>
  </body>
</html>