<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Bom dia Hélio,<br>
    <br>
          Estou rodando a rotina novamente no R 3.1.2 e 3.0.2 em windows
    e não estou conseguindo replicar o seu erro,<br>
    <br>
    Abraço,<br>
    <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>                   
======================================================================</pre>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">Em 15/09/2015 08:57, Hélio Gallo Rocha
      escreveu:<br>
    </div>
    <blockquote
cite="mid:CA+ppPW7x=2T1a5nkpTLrTULE6M3JmCxkXL_K1XJOJqY1NW3=JQ@mail.gmail.com"
      type="cite">
      <div dir="ltr">Alexandre, bom dia.
        <div><br>
        </div>
        <div>Não consegui identificar essa msg de erro, que ocorre após
          executar a ultima linha:</div>
        <div><br>
        </div>
        <div>
          <div>x_hm <- heatmap(cr, Rowv=FALSE, Colv=FALSE,
            dendrogram="none",col=paleta,</div>
          <div>trace="none", cellnote=xval, notecol="black",
            notecex=0.8)</div>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>msg de erro:</div>
        <div>
          <div>Error in hclustfun(distfun(x)) : </div>
          <div>  NA/NaN/Inf em chamada de função externa (argumento 11)</div>
        </div>
        <div><br>
        </div>
        <div>OBS: retirei o ".2" após a função heatmap, poiis com esse
          dois, não rodava.</div>
        <div><br>
        </div>
        <div>abraço</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">Em 14 de setembro de 2015 21:15,
          ASANTOS [via R-br] <span dir="ltr"><<a
              moz-do-not-send="true"
              href="mailto:ml-node+s2285057n4665047h25@n4.nabble.com"
              target="_blank"><a class="moz-txt-link-abbreviated" href="mailto:ml-node+s2285057n4665047h25@n4.nabble.com">ml-node+s2285057n4665047h25@n4.nabble.com</a></a>></span>
          escreveu:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div>
              <blockquote style="border-left:2px solid #cccccc;padding:0
                1em" type="cite"> Agora sim Hélio,<br>
                <br>
                     Agora com correlação direta e inversa e com cores,
                segue CRM:<br>
                <br>
                #Pacote<br>
                require(gplots)<br>
                <br>
                #Variáveis artificiais<br>
                dados<-runif(1000)<br>
                dados<-(dados*100)+c(1:500, 500:1)<br>
                dados<-matrix(dados,nrow=100,ncol=10)<br>
                dados<-as.data.frame(dados)<br>
                names(dados)<-c("var1",
                "var2","var3","var4","var5","var6","var7","var8","var9","var10")<br>
                <br>
                <br>
                #Função by Walmes<br>
                pn <- function(X){crossprod(!<a
                  moz-do-not-send="true" href="http://is.na"
                  target="_blank">is.na</a>(X))}<br>
                <br>
                cor.prob <- function(X){<br>
                     pair.SampSize <- pn(X)<br>
                     above1 <- row(pair.SampSize) <
                col(pair.SampSize)<br>
                     pair.df <- pair.SampSize[above1] - 2<br>
                <br>
                     R <- cor(X, use="pair")<br>
                     above2 <- row(R) < col(R)<br>
                     r2 <- R[above2]^2<br>
                     Fstat <- (r2 * pair.df)/(1 - r2)<br>
                     R[above2] <- 1 - pf(Fstat, 1, pair.df)<br>
                     R<br>
                     }<br>
                <br>
                <br>
                correla <- round(cor.prob(dados),4)<br>
                <br>
                <br>
                #Função by Helio<br>
                <br>
                sig<-0.05## Significância pos<br>
                <br>
                rP<-0.50 ## Correlação positiva<br>
                rN<--0.50## Correlação negativa<br>
                <br>
                cor.probC <- function(x){<br>
                <br>
                    results <- x<br>
                    ifelse(row(x)<
                col(x),ifelse(x<=sig,NA,x),ifelse(x<=rP&x>=rN,NA,x))<br>
                }<br>
                <br>
                cr <- cor.probC(correla)<br>
                colnames(cr)  <- names(dados)<br>
                rownames(cr) <- names(dados)<br>
                cr<br>
                #<br>
                <br>
                #Plota a matriz<br>
                paleta<- colorRampPalette(c(rgb(0.96,0.96,1),
                rgb(0.1,0.1,0.9)), space = "rgb")<br>
                xval <- formatC(cr, format="f", digits=2)<br>
                x_hm <- heatmap.2(cr, Rowv=FALSE, Colv=FALSE,
                dendrogram="none",col=paleta,<br>
                trace="none", cellnote=xval, notecol="black",
                notecex=0.8)<br>
                #<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="http:///user/SendEmail.jtp?type=node&node=4665047&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a> 
        <a moz-do-not-send="true" href="http:///user/SendEmail.jtp?type=node&node=4665047&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a> 
Lattes: <a moz-do-not-send="true" href="http://lattes.cnpq.br/1360403201088680" rel="nofollow" link="external" target="_blank">http://lattes.cnpq.br/1360403201088680</a>                   
======================================================================</pre>
                <br>
                <br>
                <br>
                <div>Em 02/09/2015 22:29, Hélio Gallo Rocha escreveu:<br>
                </div>
                <blockquote style="border-left:2px solid
                  #cccccc;padding:0 1em" type="cite">
                  <p dir="ltr">Alexandre. Estou num celular,  mas acho
                    que incluindo o caracter & no campo relativo a
                    correlação, vai funcionar </p>
                  <div class="gmail_quote">Em 02/09/2015 22:36, "ASANTOS
                    [via R-br]" <<a moz-do-not-send="true"
                      href="http:///user/SendEmail.jtp?type=node&node=4665047&i=2"
                      rel="nofollow" link="external" target="_blank">[hidden
                      email]</a>> escreveu:<br type="attribution">
                    <blockquote style="border-left:2px solid
                      #cccccc;padding:0 1em" class="gmail_quote"> Boa
                      noite Helio, <br>
                      <br>
                              O problema é que a função some também com
                      variáveis <br>
                      significantes mas inversamente correlacionadas, se
                      altero <br>
                      ifelse(x>=0.08,NA,x), tenho o problema inverso.
                      Veja as alterações que <br>
                      fiz, também criei uma estrutura de correlação um
                      pouco melhor nos dados <br>
                      artificiais. Outro problema para colorir estão
                      sendo os NA's, mas acho <br>
                      que estamos chegando lá, segue o CRM: <br>
                      <br>
                      #Variáveis artificiais <br>
                      dados<-runif(1000) <br>
                      dados<-(dados*100)+c(1:500, 500:1) <br>
                      dados<-matrix(dados,nrow=100,ncol=10) <br>
                      dados<-as.data.frame(dados) <br>
                      names(dados)<-c("var1", <br>
                      "var2","var3","var4","var5","var6","var7","var8","var9","var10")



                      <br>
                      <br>
                      <br>
                      #Função by Walmes <br>
                      pn <- function(X){crossprod(!<a
                        moz-do-not-send="true" href="http://is.na"
                        rel="nofollow" link="external" target="_blank">is.na</a>(X))}
                      <br>
                      <br>
                      cor.prob <- function(X){ <br>
                            pair.SampSize <- pn(X) <br>
                            above1 <- row(pair.SampSize) <
                      col(pair.SampSize) <br>
                            pair.df <- pair.SampSize[above1] - 2 <br>
                      <br>
                            R <- cor(X, use="pair") <br>
                            above2 <- row(R) < col(R) <br>
                            r2 <- R[above2]^2 <br>
                            Fstat <- (r2 * pair.df)/(1 - r2) <br>
                            R[above2] <- 1 - pf(Fstat, 1, pair.df) <br>
                            R <br>
                            } <br>
                      <br>
                      <br>
                      correla <- round(cor.prob(dados),4) <br>
                      <br>
                      <br>
                      #Função by Helio <br>
                      <br>
                      sig<-0.05## Significância <br>
                      r<-0.30 ## Correlação <br>
                      <br>
                      cor.probC <- function(x){ <br>
                      <br>
                           results <- x <br>
                           ifelse(row(x)<
                      col(x),ifelse(x<=sig,NA,x),ifelse(x<=r,NA,x))
                      <br>
                      } <br>
                      <br>
                      cr <- cor.probC(correla) <br>
                      colnames(cr)  <- names(dados) <br>
                      rownames(cr) <- names(dados) <br>
                      cr <br>
                      # <br>
                      <br>
                      Abraço, <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=<a class="moz-txt-link-rfc2396E" href="tel:%28%2B55%29%2065%208132-8112">"tel:%28%2B55%29%2065%208132-8112"</a> value="<a
                        moz-do-not-send="true"
                        href="tel:%2B556581328112" value="+556581328112"
                        target="_blank">+556581328112</a>"
                      target="_blank"><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=<a class="moz-txt-link-rfc2396E" href="tel:%28%2B55%29%2065%209686-6970">"tel:%28%2B55%29%2065%209686-6970"</a> value="<a
                        moz-do-not-send="true"
                        href="tel:%2B556596866970" value="+556596866970"
                        target="_blank">+556596866970</a>"
                      target="_blank"><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>
                      e-mails:<a moz-do-not-send="true"
                        href="http:///user/SendEmail.jtp?type=node&node=4665035&i=0"
                        rel="nofollow" link="external" target="_blank">[hidden

                        email]</a> <br>
                               <a moz-do-not-send="true"
                        href="http:///user/SendEmail.jtp?type=node&node=4665035&i=1"
                        rel="nofollow" link="external" target="_blank">[hidden

                        email]</a> <br>
                      Lattes: <a moz-do-not-send="true"
                        href="http://lattes.cnpq.br/1360403201088680"
                        rel="nofollow" link="external" target="_blank">http://lattes.cnpq.br/1360403201088680</a><br>
                      ======================================================================



                      <br>
                      <br>
                      <br>
                      <br>
                      <br>
                      <br>
                      <br>
                      <br>
                      <br>
                      <br>
                      <br>
                      Em 02/09/2015 12:09, Hélio Gallo Rocha escreveu: <br>
                      > var1<-sort(rnorm(30,1), decreasing = TRUE)
                      <br>
                      > var2<-rnorm(30,10) <br>
                      > var3<-sort(rnorm(30,22)) <br>
                      > var4<-sort(rnorm(30,10)) <br>
                      > var5<-sort(rnorm(30,0.5), decreasing =
                      TRUE) <br>
                      > var6<-sort(rnorm(30,25), decreasing =
                      TRUE) <br>
                      > var7<-rnorm(30,10) <br>
                      >
                      dados<-cbind(var1,var2,var3,var4,var5,var6,var7)
                      <br>
                      <br>
                      _______________________________________________ <br>
                      R-br mailing list <br>
                      <a moz-do-not-send="true"
                        href="http:///user/SendEmail.jtp?type=node&node=4665035&i=2"
                        rel="nofollow" link="external" target="_blank">[hidden

                        email]</a> <br>
                      <a moz-do-not-send="true"
                        href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
                        rel="nofollow" link="external" 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="nofollow" link="external" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>)
                      e forneça código mínimo reproduzível. <br>
                      <br>
                      <br>
                      <hr noshade="noshade" size="1" color="#cccccc">
                      <div style="color:#444;font:12px
                        tahoma,geneva,helvetica,arial,sans-serif">
                        <div style="font-weight:bold">If you reply to
                          this email, your message will be added to the
                          discussion below:</div>
                        <a moz-do-not-send="true"
href="http://r-br.2285057.n4.nabble.com/R-br-Exibicao-de-matriz-de-correlacao-dada-uma-condicao-tp4664911p4665035.html"
                          rel="nofollow" link="external" target="_blank">http://r-br.2285057.n4.nabble.com/R-br-Exibicao-de-matriz-de-correlacao-dada-uma-condicao-tp4664911p4665035.html</a>
                      </div>
                      <div style="color:#666;font:11px
tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                        To unsubscribe from R-br, <a
                          moz-do-not-send="true" rel="nofollow"
                          link="external">click here</a>.<br>
                        <a moz-do-not-send="true"
href="http://r-br.2285057.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml"
                          rel="nofollow" style="font:9px serif"
                          link="external" target="_blank">NAML</a> </div>
                    </blockquote>
                  </div>
                  <br>
                  <fieldset></fieldset>
                  <br>
                  <pre>_______________________________________________
R-br mailing list
<a moz-do-not-send="true" href="http:///user/SendEmail.jtp?type=node&node=4665047&i=3" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<a moz-do-not-send="true" href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="nofollow" link="external" target="_blank">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a>
Leia o guia de postagem (<a moz-do-not-send="true" href="http://www.leg.ufpr.br/r-br-guia" rel="nofollow" link="external" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código mínimo reproduzível.</pre>
                </blockquote>
                <br>
              </blockquote>
              <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="http:///user/SendEmail.jtp?type=node&node=4665047&i=4" rel="nofollow" link="external" target="_blank">[hidden email]</a> 
        <a moz-do-not-send="true" href="http:///user/SendEmail.jtp?type=node&node=4665047&i=5" rel="nofollow" link="external" target="_blank">[hidden email]</a> 
Lattes: <a moz-do-not-send="true" href="http://lattes.cnpq.br/1360403201088680" rel="nofollow" link="external" target="_blank">http://lattes.cnpq.br/1360403201088680</a>                   
======================================================================
</pre>
              <br>
            </div>
            <br>
            <br>
            _______________________________________________
            <br>
            R-br mailing list
            <br>
            <a moz-do-not-send="true"
              href="http:///user/SendEmail.jtp?type=node&node=4665047&i=6"
              rel="nofollow" link="external" target="_blank">[hidden
              email]</a>
            <br>
            <a moz-do-not-send="true"
              href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br"
              rel="nofollow" link="external" 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="nofollow"
              link="external" target="_blank">http://www.leg.ufpr.br/r-br-guia</a>)
            e forne�a c�digo m�nimo reproduz�vel. <br>
            <br>
            <hr noshade="noshade" size="1" color="#cccccc">
            <div style="color:#444;font:12px
              tahoma,geneva,helvetica,arial,sans-serif">
              <div style="font-weight:bold">If you reply to this email,
                your message will be added to the discussion below:</div>
              <a moz-do-not-send="true"
href="http://r-br.2285057.n4.nabble.com/R-br-Exibicao-de-matriz-de-correlacao-dada-uma-condicao-RESOLVIDO-tp4665047.html"
                target="_blank">http://r-br.2285057.n4.nabble.com/R-br-Exibicao-de-matriz-de-correlacao-dada-uma-condicao-RESOLVIDO-tp4665047.html</a>
            </div>
            <div style="color:#666;font:11px
tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
              To unsubscribe from R-br, <a moz-do-not-send="true"
href="http://r-br.2285057.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3357982&code=aGVsaW9nYWxsb3JvY2hhQGdtYWlsLmNvbXwzMzU3OTgyfC0xMzQ3NTkwMDY4"
                target="_blank">click here</a>.<br>
              <a moz-do-not-send="true"
href="http://r-br.2285057.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml"
                rel="nofollow" style="font:9px serif" target="_blank">NAML</a>
            </div>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature">Hélio Gallo Rocha<br>
          IFSULDEMINAS - Câmpus Muzambinho<br>
        </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>
    <pre class="moz-signature" cols="72">
</pre>
  </body>
</html>