<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Obrigado Rafael, segue corrigido, em vez de e "&" eu quero ou
    "|", deu certo, segue resultado:<br>
    <br>
    RES$classes<-
    ifelse((RES$var)=="A"|(RES$var)=="C"|(RES$var)=="F"|(RES$var)=="H","Classe1",
    ifelse(RES$var=="B", "Classe2", <br>
    ifelse(RES$var=="W","Classe3","Classe4")))<br>
    <pre class="moz-signature" cols="72">-- 
======================================================================
Alexandre dos Santos
Proteção Florestal 
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial 
Cáceres - MT                      CEP: 78.200-000
Fone: (+55) 65 8132-8112 (TIM)   (+55) 65 9686-6970 (VIVO)
<a class="moz-txt-link-abbreviated" href="mailto:e-mails:alexandresantosbr@yahoo.com.br">e-mails:alexandresantosbr@yahoo.com.br</a> 
        <a class="moz-txt-link-abbreviated" href="mailto:alexandre.santos@cas.ifmt.edu.br">alexandre.santos@cas.ifmt.edu.br</a> 
Lattes: <a class="moz-txt-link-freetext" href="http://lattes.cnpq.br/1360403201088680">http://lattes.cnpq.br/1360403201088680</a>
OrcID: orcid.org/0000-0001-8232-6722 
Researchgate: <a class="moz-txt-link-freetext" href="https://www.researchgate.net/profile/Alexandre_Santos10">https://www.researchgate.net/profile/Alexandre_Santos10</a>                       
LinkedIn: <a class="moz-txt-link-freetext" href="https://br.linkedin.com/in/alexandre-dos-santos-87961635">https://br.linkedin.com/in/alexandre-dos-santos-87961635</a>
======================================================================
</pre>
    <div class="moz-cite-prefix">Em 22/03/2016 10:53, Rafael Garcia
      Cunha escreveu:<br>
    </div>
    <blockquote
cite="mid:CAGFfgXJhgQF5vVS_HgByjM_YfDa1+PBB2wuPPwZNrGm+xbLy-Q@mail.gmail.com"
      type="cite">
      <div dir="ltr">Além disso, não tinha reparado, a comparação que
        você deseja pra Classe 1 é "A" ou "C" ou "F" ou "H", pois não dá
        pra ser A e C e F e H juntos, certo?</div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">Em 22 de março de 2016 11:50, Rafael
          Garcia Cunha <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:rafareds@gmail.com" target="_blank">rafareds@gmail.com</a>></span>
          escreveu:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Pra fazer comparação de igualdade use "=="</div>
            <div class="gmail_extra"><br>
              <div class="gmail_quote">
                <div>
                  <div class="h5">Em 22 de março de 2016 11:44, ASANTOS
                    <span dir="ltr"><<a moz-do-not-send="true"
                        href="mailto:alexandresantosbr@yahoo.com.br"
                        target="_blank">alexandresantosbr@yahoo.com.br</a>></span>
                    escreveu:<br>
                  </div>
                </div>
                <blockquote class="gmail_quote" style="margin:0 0 0
                  .8ex;border-left:1px #ccc solid;padding-left:1ex">
                  <div>
                    <div class="h5">
                      <div bgcolor="#FFFFFF" text="#000000"> Prezados
                        Listeiros,<br>
                        <br>
                             Gostaria de saber por que a abordagem
                        indicada pelo Rafael não funciona para
                        caracteres, sendo:<br>
                        <br>
                        ##Agregação de tratamentos<br>
                        RES<-NULL<br>
                        RES$var<-sample(LETTERS, 100, replace=TRUE)<br>
                        RES$classes<-
                        ifelse((RES$var)="A"&(RES$var)="C"&(RES$var)="F"&(RES$var)="H","Classe1",

                        ifelse(RES$var="B", "Classe2", <br>
                        ifelse(RES$var="W","Classe3","Classe4"))) <br>
                        <span>
                          <pre cols="72">-- 
======================================================================
Alexandre dos Santos
Proteção Florestal 
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial 
Cáceres - MT                      CEP: 78.200-000
Fone: <a moz-do-not-send="true" href="tel:%28%2B55%29%2065%208132-8112" value="+556581328112" target="_blank">(+55) 65 8132-8112</a> (TIM)   <a moz-do-not-send="true" href="tel:%28%2B55%29%2065%209686-6970" value="+556596866970" target="_blank">(+55) 65 9686-6970</a> (VIVO)
<a moz-do-not-send="true" href="mailto:e-mails:alexandresantosbr@yahoo.com.br" target="_blank">e-mails:alexandresantosbr@yahoo.com.br</a> 
        <a moz-do-not-send="true" href="mailto:alexandre.santos@cas.ifmt.edu.br" target="_blank">alexandre.santos@cas.ifmt.edu.br</a> 
Lattes: <a moz-do-not-send="true" href="http://lattes.cnpq.br/1360403201088680" target="_blank">http://lattes.cnpq.br/1360403201088680</a>
OrcID: <a moz-do-not-send="true" href="http://orcid.org/0000-0001-8232-6722" target="_blank">orcid.org/0000-0001-8232-6722</a> 
Researchgate: <a moz-do-not-send="true" href="https://www.researchgate.net/profile/Alexandre_Santos10" target="_blank">https://www.researchgate.net/profile/Alexandre_Santos10</a>                       
LinkedIn: <a moz-do-not-send="true" href="https://br.linkedin.com/in/alexandre-dos-santos-87961635" target="_blank">https://br.linkedin.com/in/alexandre-dos-santos-87961635</a>
======================================================================
</pre>
                        </span>
                        <div>Em 22/03/2016 10:35, ASANTOS escreveu:<br>
                        </div>
                        <blockquote type="cite"> Muito obrigado Rafael,<br>
                          <br>
                          Resolvido:<br>
                          <br>
                          RES<-NULL<br>
RES$var<-c(rnorm(10,1),rnorm(15,7),rnorm(15,10),rnorm(50,25))<br>
                          RES$classes<-
                          ifelse(RES$var<=1,"Classe1",
                          ifelse((RES$var)>1&(RES$var)<=2,
                          "Classe2", <br>
                          ifelse((RES$var)>2&(RES$var)<=10,
                          "Classe3","Classe4")))<span><br>
                            <br>
                            <pre cols="72">-- 
======================================================================
Alexandre dos Santos
Proteção Florestal 
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial 
Cáceres - MT                      CEP: 78.200-000
Fone: <a moz-do-not-send="true" href="tel:%28%2B55%29%2065%208132-8112" value="+556581328112" target="_blank">(+55) 65 8132-8112</a> (TIM)   <a moz-do-not-send="true" href="tel:%28%2B55%29%2065%209686-6970" value="+556596866970" target="_blank">(+55) 65 9686-6970</a> (VIVO)
<a moz-do-not-send="true" href="mailto:e-mails:alexandresantosbr@yahoo.com.br" target="_blank">e-mails:alexandresantosbr@yahoo.com.br</a> 
        <a moz-do-not-send="true" href="mailto:alexandre.santos@cas.ifmt.edu.br" target="_blank">alexandre.santos@cas.ifmt.edu.br</a> 
Lattes: <a moz-do-not-send="true" href="http://lattes.cnpq.br/1360403201088680" target="_blank">http://lattes.cnpq.br/1360403201088680</a>
OrcID: <a moz-do-not-send="true" href="http://orcid.org/0000-0001-8232-6722" target="_blank">orcid.org/0000-0001-8232-6722</a> 
Researchgate: <a moz-do-not-send="true" href="https://www.researchgate.net/profile/Alexandre_Santos10" target="_blank">https://www.researchgate.net/profile/Alexandre_Santos10</a>                       
LinkedIn: <a moz-do-not-send="true" href="https://br.linkedin.com/in/alexandre-dos-santos-87961635" target="_blank">https://br.linkedin.com/in/alexandre-dos-santos-87961635</a>
======================================================================
</pre>
                          </span>
                          <div>
                            <div>
                              <div>Em 22/03/2016 10:22, Rafael Garcia
                                Cunha escreveu:<br>
                              </div>
                            </div>
                          </div>
                          <blockquote type="cite">
                            <div>
                              <div>
                                <div dir="ltr">RES$classes<-
                                  ifelse(RES$var<=1, "Classe1",
                                  ifelse(RES$var<=2, "Classe2",
                                  ifelse(RES$var<=10, "Classe3",
                                  "Classe4")))<br>
                                  <div><br>
                                  </div>
                                  <div>Para colocar 2 comparações você
                                    precisa identificar o que você está
                                    querendo comparar entre os "&",
                                    algo do
                                    tipo: ifelse((RES$var)>1&(RES$var)<=2</div>
                                  <div><br>
                                  </div>
                                  <div>Só que se você notar, você está
                                    trabalhando com ifelse, então, se o
                                    primeiro if não for atendido, ele já
                                    é maior que 1, então não precisa
                                    fazer essa comparação novamente.</div>
                                  <div><br>
                                  </div>
                                </div>
                                <div class="gmail_extra"><br>
                                  <div class="gmail_quote">Em 22 de
                                    março de 2016 10:58, ASANTOS <span
                                      dir="ltr"><<a
                                        moz-do-not-send="true"
                                        href="mailto:alexandresantosbr@yahoo.com.br"
                                        target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:alexandresantosbr@yahoo.com.br">alexandresantosbr@yahoo.com.br</a></a>></span>
                                    escreveu:<br>
                                    <blockquote class="gmail_quote"
                                      style="margin:0 0 0
                                      .8ex;border-left:1px #ccc
                                      solid;padding-left:1ex">Prezados
                                      listeiros,<br>
                                      <br>
                                            Gostaria se criar uma coluna
                                      de classificação do meu objeto var
                                      em classes, segundo intervalos
                                      arbitrários como quando <=1 vai
                                      se chamar "Classe1", >1 e <2
                                      vai se chamar "Classe2", etc.
                                      Porém o meu objeto de
                                      classificação RES$classes não esta
                                      dando certo aliás é uma dúvida que
                                      sempre tenho, quando utilizo
                                      parênteses ou chaves entre as
                                      funções. Segue meu código:<br>
                                      <br>
                                      RES<-NULL<br>
RES$var<-c(rnorm(10,1),rnorm(15,7),rnorm(15,10),rnorm(50,25))<br>
                                      RES$classes<-
                                      ifelse(RES$var<=1, "Classe1",
                                      ifelse(RES$var>1&<=2,
                                      "Classe2",
                                      ifelse(RES$var>2&<=10,
                                      "Classe3", if(RES$var>10,
                                      "Classe4"))))<br>
                                      <br>
                                      Obrigado,<br>
                                      <br>
                                      -- <br>
======================================================================<br>
                                      Alexandre dos Santos<br>
                                      Proteção Florestal<br>
                                      IFMT - Instituto Federal de
                                      Educação, Ciência e Tecnologia de
                                      Mato Grosso<br>
                                      Campus Cáceres<br>
                                      Caixa Postal 244<br>
                                      Avenida dos Ramires, s/n<br>
                                      Bairro: Distrito Industrial<br>
                                      Cáceres - MT                     
                                      CEP: 78.200-000<br>
                                      Fone: <a moz-do-not-send="true"
                                        href="tel:%28%2B55%29%2065%208132-8112"
                                        value="+556581328112"
                                        target="_blank">(+55) 65
                                        8132-8112</a> (TIM)   <a
                                        moz-do-not-send="true"
                                        href="tel:%28%2B55%29%2065%209686-6970"
                                        value="+556596866970"
                                        target="_blank">(+55) 65
                                        9686-6970</a> (VIVO)<br>
                                      <a moz-do-not-send="true"
                                        href="mailto:e-mails%3Aalexandresantosbr@yahoo.com.br"
                                        target="_blank">e-mails:alexandresantosbr@yahoo.com.br</a><br>
                                              <a moz-do-not-send="true"
href="mailto:alexandre.santos@cas.ifmt.edu.br" target="_blank">alexandre.santos@cas.ifmt.edu.br</a><br>
                                      Lattes: <a moz-do-not-send="true"
href="http://lattes.cnpq.br/1360403201088680" rel="noreferrer"
                                        target="_blank">http://lattes.cnpq.br/1360403201088680</a><br>
                                      OrcID: <a moz-do-not-send="true"
href="http://orcid.org/0000-0001-8232-6722" rel="noreferrer"
                                        target="_blank">orcid.org/0000-0001-8232-6722</a><br>
                                      Researchgate: <a
                                        moz-do-not-send="true"
                                        href="https://www.researchgate.net/profile/Alexandre_Santos10"
                                        rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="https://www.researchgate.net/profile/Alexandre_Santos10">https://www.researchgate.net/profile/Alexandre_Santos10</a></a><br>
                                      LinkedIn: <a
                                        moz-do-not-send="true"
                                        href="https://br.linkedin.com/in/alexandre-dos-santos-87961635"
                                        rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="https://br.linkedin.com/in/alexandre-dos-santos-87961635">https://br.linkedin.com/in/alexandre-dos-santos-87961635</a></a><br>
======================================================================<br>
                                      <br>
_______________________________________________<br>
                                      R-br mailing list<br>
                                      <a moz-do-not-send="true"
                                        href="mailto:R-br@listas.c3sl.ufpr.br"
                                        target="_blank">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"
                                        rel="noreferrer" 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"
                                        rel="noreferrer" target="_blank"><a class="moz-txt-link-freetext" href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a></a>)
                                      e fornea cdigo mnimo reproduzvel.</blockquote>
                                  </div>
                                  <br>
                                  <br clear="all">
                                  <div><br>
                                  </div>
                                  -- <br>
                                  <div>
                                    <div>Rafael Garcia Cunha</div>
                                    <div><br>
                                    </div>
                                    <div>YNWA</div>
                                    <div><br>
                                    </div>
                                  </div>
                                </div>
                                <br>
                                <fieldset></fieldset>
                                <br>
                              </div>
                            </div>
                            <pre><div><div>_______________________________________________
R-br mailing list
<a moz-do-not-send="true" href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a>
<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></div></div>
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.</pre>
                          </blockquote>
                          <br>
                          <br>
                          <fieldset></fieldset>
                          <br>
                          <pre><span>_______________________________________________
R-br mailing list
<a moz-do-not-send="true" href="mailto:R-br@listas.c3sl.ufpr.br" target="_blank">R-br@listas.c3sl.ufpr.br</a>
<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></span>
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.</pre>
                        </blockquote>
                        <br>
                      </div>
                      <br>
                      _______________________________________________<br>
                      R-br mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:R-br@listas.c3sl.ufpr.br"
                        target="_blank">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"
                        rel="noreferrer" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br>
                    </div>
                  </div>
                  Leia o guia de postagem (<a moz-do-not-send="true"
                    href="http://www.leg.ufpr.br/r-br-guia"
                    rel="noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>)
                  e forneça código mínimo reproduzível.<br>
                </blockquote>
              </div>
              <span class=""><br>
                <br clear="all">
                <div><br>
                </div>
                -- <br>
                <div>
                  <div>Rafael Garcia Cunha</div>
                  <div><br>
                  </div>
                  <div>YNWA</div>
                  <div><br>
                  </div>
                </div>
              </span></div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature">
          <div>Rafael Garcia Cunha</div>
          <div><br>
          </div>
          <div>YNWA</div>
          <div><br>
          </div>
        </div>
      </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>
  </body>
</html>