<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Olhe a documentação do ifelse<br>
    <pre class="moz-signature" cols="72">[]s
Leonard de Assis
assis <dot> leonard <at> gmail <dot> com
</pre>
    <br>
    Em 12/01/2012 00:27, Carlos Andrade escreveu:
    <blockquote
cite="mid:CA+_U+LxdMH0Q6tG1PKrK3_xF5+TDRtncbH873LRZjyOkvu=_pQ@mail.gmail.com"
      type="cite">Prezados amigos da lista
      <div><br>
      </div>
      <div>Que 2012 seja repleto de sucesso.</div>
      <div><br>
      </div>
      <div>Minha dúvida.</div>
      <div>Elaborei um questionário e atribuí pontos para as diferentes
        respostas. Como codifico uma função para gerar uma variável que
        será o resultado da computação da soma dos pontos de cada
        indivíduo de acordo com suas respostas?</div>
      <div>Abaixo segue o esquema de pontuação das questões que entram
        no cálculo.</div>
      <div><br>
      </div>
      <div>
        <div>Pergunta Resposta Pontuação</div>
        <div>p1<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>2<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>3<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>p2<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>2<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>3<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>4<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>5<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>6<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>p3.1<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P3.2<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P3.3<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P3.4<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P3.5<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P3.6<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P3.7<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>p4<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>2<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>3<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>4<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>5<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>6<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P5.1<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P5.2<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P5.3<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P5.4<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P5.5<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P5.6<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P5.7<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P5.8<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P5.9<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P5.10<span class="Apple-tab-span" style="white-space:pre">
          </span>1<span class="Apple-tab-span" style="white-space:pre">
          </span>0</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>p6<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>2<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>3<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>4<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>5<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>6<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P7.1<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P7.2<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P7.3<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P7.4<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P7.5<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P7.6<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P7.7<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P8.1<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P8.2<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P8.3<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P8.4<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P8.5<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P9.1<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P9.2<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P9.3<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P9.4<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P9.5<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P9.6<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P9.7<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P10.1<span class="Apple-tab-span" style="white-space:pre">
          </span>1<span class="Apple-tab-span" style="white-space:pre">
          </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P10.2<span class="Apple-tab-span" style="white-space:pre">
          </span>1<span class="Apple-tab-span" style="white-space:pre">
          </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P10.3<span class="Apple-tab-span" style="white-space:pre">
          </span>1<span class="Apple-tab-span" style="white-space:pre">
          </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P10.4<span class="Apple-tab-span" style="white-space:pre">
          </span>1<span class="Apple-tab-span" style="white-space:pre">
          </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P10.5<span class="Apple-tab-span" style="white-space:pre">
          </span>1<span class="Apple-tab-span" style="white-space:pre">
          </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P10.6<span class="Apple-tab-span" style="white-space:pre">
          </span>1<span class="Apple-tab-span" style="white-space:pre">
          </span>0</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>P10.7<span class="Apple-tab-span" style="white-space:pre">
          </span>1<span class="Apple-tab-span" style="white-space:pre">
          </span>0</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>0<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>p11<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>2<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>3<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>4<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>5<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div>p15<span class="Apple-tab-span" style="white-space:pre"> </span>1<span
            class="Apple-tab-span" style="white-space:pre"> </span>5</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>2<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>3<span
            class="Apple-tab-span" style="white-space:pre"> </span>3</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>4<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>5<span
            class="Apple-tab-span" style="white-space:pre"> </span>1</div>
        <div><span class="Apple-tab-span" style="white-space:pre"> </span>6<span
            class="Apple-tab-span" style="white-space:pre"> </span>0</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Também: como substituir os NAs por zeros de uma vez só?</div>
        <div><br>
        </div>
        <div>Agradeço antecipadamente qualquer ajuda.</div>
        <div><br>
        </div>
        -- <br>
        Atenciosamente,<br>
        <br>
        Prof. Carlos A. S. de Andrade<br>
        LAPEA - Laboratório de Pesquisa em Economia Aplicada e
        Engenharia de Produção<br>
        <div>Universidade Federal de Campina Grande.<br>
        </div>
        <div> Centro de Humanidades 
           </div>
        <div>Unidade Acadêmica de Economia</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>
  </body>
</html>