<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div><span>Bom Dia Pessoal,</span></div><div><span>     Estava tentando tirar à média de 3 fatores para densidade de insetos, sendo 4, 16 e 64</span> insetos e cada fator com 10 repetições, porém em 4 insetos tenho 3 NA' s</div><div>e quando tento usar tapply() a função dá erro obviamente, pois são comprimentos diferentes, sendo:<br></div><div><br></div><div> <br></div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Arial; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: 16px;"><span class="Apple-style-span" style="font-family: Monospace; font-size: 13px; line-height: 17px; text-align:
 -webkit-left; white-space: pre-wrap; "><pre tabindex="0" class="GD40030CLR" style="font-family: Monospace; font-size: 10pt !important; outline-style: none; outline-width: initial; outline-color: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; white-space: pre-wrap !important; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 1.3; "><span class="GD40030COR ace_keyword" style="white-space: pre; color: blue; ">> </span><span class="GD40030CCR ace_keyword" style="color: blue; ">medias<-tapply(na.omit(n.provas),densidade,mean)
</span><span class="GD40030CGR">Erro em tapply(na.omit(n.provas), densidade, mean) : 
  argumentos devem ter o mesmo comprimento
</span><span class="GD40030COR ace_keyword" style="white-space: pre; color: blue; ">> </span><span class="GD40030CCR ace_keyword" style="color: blue; ">medias
</span>16prey  4prey 64prey 
   4.0     NA   12.4 <br><br>Alguém saberia sugerir outra função, sendo que já tentei aggregate() também sem sucesso,<br>Obrigado,<br><br>Alexandre<br><br></pre></span></span></div></div></body></html>