<font face="trebuchet ms,sans-serif">Rodrigo,<br><br>Além de help(unstack) você pode conferir essa matéria do R-bloggers <a href="http://www.r-bloggers.com/reshape-package-in-r-long-data-format-to-wide-back-to-long-again/">http://www.r-bloggers.com/reshape-package-in-r-long-data-format-to-wide-back-to-long-again/</a><br>
<br>À disposição.<br>Walmes.<br><br clear="all"></font><span style="font-family: trebuchet ms,sans-serif;">==========================================================================</span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">Walmes Marques Zeviani</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)</span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">Departamento de Estatística - Universidade Federal do Paraná</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">fone: (+55) 41 3361 3573</span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">VoIP: (3361 3600) 1053 1173</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">e-mail: <a href="mailto:walmes@ufpr.br" target="_blank">walmes@ufpr.br</a></span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">twitter: @walmeszeviani</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">homepage: <a href="http://www.leg.ufpr.br/%7Ewalmes" target="_blank">http://www.leg.ufpr.br/~walmes</a></span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">linux user number: 531218</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">==========================================================================</span><br>
<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: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); 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: 96pt; margin-left: 2.75pt; border-collapse: collapse;" width="128" border="0" cellpadding="0" cellspacing="0">
<tbody><tr style="min-height: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 0.0001pt; text-align: right; line-height: normal;" align="right">
<span style="color: black;"><font size="1">0</font></span></p>
</td>
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 0.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: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: right; line-height: normal;" align="right"><span style="color: black;"><font size="1">8</font></span></p>
</td>
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: right; line-height: normal;" align="right"><span style="color: black;"><font size="1">0</font></span></p>
</td>
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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: 15pt;">
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.0001pt; text-align: right; line-height: normal;" align="right"><span style="color: black;"><font size="1">0</font></span></p>
</td>
<td style="width: 48pt; padding: 0cm 3.5pt; min-height: 15pt;" nowrap valign="bottom" width="64">
<p class="MsoNormal" style="margin-bottom: 0.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>