Tente assim:<br><br><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-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: 'Lucida Console'; font-size: 11px; line-height: 13px; text-align: -webkit-left; white-space: nowrap; "><pre tabindex="0" class="G1dpdwhmFL" style="font-family: 'Lucida Console'; font-size: 8pt !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; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; line-height: 1.3; ">

<span class="G1dpdwhmMK  ace_keyword" style="color: blue; ">unstack(x, resposta ~ fator)</span></pre></span></span><br><br><div class="gmail_quote">2011/5/16 Rodrigo Pereira <span dir="ltr"><<a href="mailto:doforodrigo@gmail.com">doforodrigo@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Caros colegas,<div><br></div><div>Estou com um problema básico, mas que não estou conseguindo resolver (falta de prática com o R...)</div>

<div><br></div><div>Estou com o seguinte banco de dados:</div><div><br></div><div><div>
                   resposta            fator           sujeito</div><div>1                   0.00                   R               1</div><div>2                   2.96                   R               1</div><div>3                  10.28                   R               1</div>


<div>4                  12.42                   R               1</div><div>5                  15.60                   R               1</div><div>6                  14.23                   R               1</div><div>7                  10.55                   R               1</div>


<div>8                   8.00                   R               1</div><div>9                   6.12                   R               1</div><div>10                  3.24                   R               1</div><div>11                  2.82                   R               1</div>


<div>12                  1.18                   R               1</div><div>13                  0.42                   R               1</div><div>14                  0.00                   R               1</div><div>15                  0.00                   R               1</div>


<div>16                  0.00                   T               2</div><div>17                  4.01                   T               2</div><div>18                 19.82                   T               2</div><div>19                 17.83                   T               2</div>


<div>20                 12.74                   T               2</div><div>21                  7.37                   T               2</div><div>22                  7.73                   T               2</div><div>23                  4.70                   T               2</div>


<div>24                  4.11                   T               2</div><div>25                  3.11                   T               2</div><div>26                  3.19                   T               2</div><div>27                  2.25                   T               2</div>


<div>28                  0.44                   T               2</div><div>29                  0.16                   T               2</div><div>30                  0.00                   T               2</div></div><div>


<br></div><div>Estou tentando utilizar a função unstack() para transformar este banco de dados longo em largo da seguinte forma:</div><div><br></div><div><table style="width:96.0pt;margin-left:2.75pt;border-collapse:collapse" width="128" border="0" cellpadding="0" cellspacing="0">


 <tbody><tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">R</font></span></p><p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right">

<span style="color:black"><font size="1">0</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1"><br></font></span></p><p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right">

<span style="color:black"><font size="1">T</font></span></p><p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">0</font></span></p>


  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">2,96</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">4,01</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">10,28</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">19,82</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">12,42</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">17,83</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">15,6</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">12,74</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">14,23</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">7,37</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">10,55</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">7,73</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">8</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">4,7</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">6,12</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">4,11</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">3,24</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">3,11</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">2,82</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">3,19</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">1,18</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">2,25</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">0,42</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">0,44</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">0</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">0,16</font></span></p>
  </td>
 </tr>
 <tr style="min-height:15.0pt">
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">0</font></span></p>
  </td>
  <td style="width:48.0pt;padding:0cm 3.5pt 0cm 3.5pt;min-height:15.0pt" valign="bottom" width="64" nowrap>
  <p class="MsoNormal" style="margin-bottom:0cm;margin-bottom:.0001pt;text-align:right;line-height:normal" align="right"><span style="color:black"><font size="1">0</font></span></p>
  </td>
 </tr></tbody></table></div><div><br clear="all">Alguém sabe como consigo fazer essa mudança com ou sem a função unstack()?</div><div><br></div><div>Obrigado e abraço!</div><div><br></div><font color="#888888"><div>Rodrigo Pereira<br>

(31)9326 3139<br>

</div>
</font><br>_______________________________________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
<a 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>
<br></blockquote></div><br><br clear="all"><br>-- <br>Henrique Dallazuanna<br>Curitiba-Paraná-Brasil<br>25° 25' 40" S 49° 16' 22" O<br>