<html><head></head><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:16px">Valeu Delcio, muito obrigado!!!<br><div id="yui_3_16_0_ym19_1_1510346106424_189989"><span></span></div><div id="yui_3_16_0_ym19_1_1510346106424_189991"> [  ]'s<br></div><div class="signature" id="yui_3_16_0_ym19_1_1510346106424_190033">Prof. Edson Lira, Me <br>Estatístico<br>Manaus-Amazonas</div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: times new roman, new york, times, serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font face="Arial" size="2"> Em Quinta-feira, 16 de Novembro de 2017 12:13, Delcio Rudinei Bortolanza via R-br <r-br@listas.c3sl.ufpr.br> escreveu:<br></font></div>  <br><br> <div class="y_msg_container"><div id="yiv6713012464"><style type="text/css">#yiv6713012464 #yiv6713012464 -- P {margin-top:0;margin-bottom:0;}#yiv6713012464 </style><div dir="ltr">
<div dir="ltr" id="yiv6713012464divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri, Helvetica, sans-serif;">
<div></div>
<div>dados<-read.table(header = F, stringsAsFactors = F, text = "</div>
<div>n     id     UF    x2002 x2003 x2004 x2005 x2006 x2007 x2008 x2009 x2011 x2012 x2013 x2014</div>
<div>1  1     Acre      192    189     311     311     333    327      338    354     357     381     337   373</div>
<div>2  2  Alagoas  1251  1269  1292    1357   1413  1410    1355  1401   1344   1391   1429  1417</div>
<div>3  3    Amapá    204   198   239   262   252   294   317   299   302   311   332   355</div>
<div>4  4 Amazonas   958  1050  1433  1528  1502  1488  1531  1673  1689  1720  1771  1908</div>
<div>5  5    Bahia  6885  6901  7167  7336  7292  7338  7665  7792  7602  7416  7530  7879</div>
<div>6  6    Ceará  3705  3871  3944  4120  4143  4138  4314  4380  4121  4184  4215  4319</div>
<div>  ")</div>
<div>dados</div>
<div>dados1<-t(dados)</div>
<div>dados1</div>
<div><br clear="none">
</div>
<div>dados2<-dados1[c(-1,-2),]</div>
<div>dados2</div>
<div><br clear="none">
</div>
<div>dados3<-as.data.frame(dados2)</div>
<div>rownames(dados3)<-NULL</div>
<div>colnames(dados3)<-NULL</div>
<div>dados3</div>
<br clear="none">
<div></div>
<br clear="none">
<br clear="none">
<div class="yiv6713012464yqt7755899012" id="yiv6713012464yqt83162"><div style="color:rgb(0, 0, 0);">
<hr style="display:inline-block;width:98%;" tabindex="-1">
<div dir="ltr" id="yiv6713012464divRplyFwdMsg"><font style="font-size:11pt;" face="Calibri, sans-serif" color="#000000"><b>De:</b> R-br <r-br-bounces@listas.c3sl.ufpr.br> em nome de Edson Lira via R-br <r-br@listas.c3sl.ufpr.br><br clear="none">
<b>Enviado:</b> quinta-feira, 16 de novembro de 2017 11:16<br clear="none">
<b>Para:</b> a lista Brasileira oficial de discussão do programa R.<br clear="none">
<b>Assunto:</b> [R-br] Reshape</font>
<div> </div>
</div>
<div>
<div style="color:#000;background-color:#fff;font-family:times new roman, new york, times, serif;font-size:16px;">
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183614"><span id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183801">Bom dia caros amigos, estou trabalhando com a base de dados abaixo(somente 6 linhas):<br clear="none">
</span></div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183758"><span><br clear="none">
</span></div>
<div dir="ltr" id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183677"><span id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183699">   id     UF    x2002 x2003 x2004 x2005 x2006 x2007 x2008 x2009 x2011 x2012 x2013 x2014<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183692" clear="none">
1  1     Acre      192    189     311     311     333    327      338    354     357     381     337   373<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183693" clear="none">
2  2  Alagoas  1251  1269  1292    1357   1413  1410    1355  1401   1344   1391   1429  1417<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183694" clear="none">
3  3    Amapá    204   198   239   262   252   294   317   299   302   311   332   355<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183695" clear="none">
4  4 Amazonas   958  1050  1433  1528  1502  1488  1531  1673  1689  1720  1771  1908<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183696" clear="none">
5  5    Bahia  6885  6901  7167  7336  7292  7338  7665  7792  7602  7416  7530  7879<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183697" clear="none">
6  6    Ceará  3705  3871  3944  4120  4143  4138  4314  4380  4121  4184  4215  4319<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183698" clear="none">
<br clear="none">
</span></div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183673"><span id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184031">Estou  usando o reshape para tentar transformar as linhas em colunas, ou seja, cada uma UF seria uma coluna, e assim com as demais</span></div>
<div><span>Como gostaria que ficasse:</span></div>
<div><span><br clear="none">
</span></div>
<div dir="ltr" id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184034"><span id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184033">Acre Alagoas Amapá Amazonas Bahia Ceará  ano<br clear="none">
</span></div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183674"><span id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184043">192      1251                                             3705  2002<br clear="none">
</span></div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184076"><span id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184075">189      1269                                             3871  2003<br clear="none">
</span></div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184078"><span id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184077">311     1293                                              3944  2004<br clear="none">
</span></div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184086"><span>...       ....</span></div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183628">
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184087"> </div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184089">Estou usando a rotina:</div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184091"><br clear="none">
</div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184093"><br clear="none">
</div>
<div dir="ltr" id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184112">pea<-reshape(pea1, <br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184141" clear="none">
                  varying=c("x2002","x2003","x2004","x2005","x2006","x2007",<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184142" clear="none">
                  "x2008","x2009","x2011","x2012","x2013","x2014"),<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184143" clear="none">
                   v.names="Medida",<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184144" clear="none">
                   timevar="UF",<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184145" clear="none">
                   times=c("Acre","Alagoas","Amapá","Amazonas","Bahia",<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184146" clear="none">
                         "Ceará","Distrito Federal","Espírito Santo",<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184147" clear="none">
                         "Goiás","Maranhão","Mato Grosso","Mato Grosso do Sul",<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184148" clear="none">
                         "Minas Gerais","Pará","Paraíba","Paraná"," Pernambuco",<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184149" clear="none">
                         "Piauí","Rio de Janeiro","Rio Grande do Norte",<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184150" clear="none">
                         "Rio Grande do Sul","Rondônia","Roraima",<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184151" clear="none">
                         "Santa Catarina","São Paulo","Sergipe","Tocantins"),<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184152" clear="none">
                   new.row.names=1:27,<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184153" clear="none">
                   direction="wide")<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184154" clear="none">
<br clear="none">
</div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184160">que está me dando o erro:</div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184237"><br clear="none">
</div>
<div dir="ltr" id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184162">Erro em varying[, i] : número incorreto de dimensões<br id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184195" clear="none">
<br clear="none">
</div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184164">Alguém tem alguma sugesstão?<br clear="none">
</div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184210"><br clear="none">
</div>
<div id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_184219">[  ]'s<br clear="none">
</div>
</div>
<div class="yiv6713012464x_signature" id="yiv6713012464x_yui_3_16_0_ym19_1_1510346106424_183630">Prof. Edson Lira, Me
<br clear="none">
Estatístico<br clear="none">
Manaus-Amazonas</div>
</div>
</div>
</div></div>
</div>
</div></div><div class="yqt7755899012" id="yqt78425">_______________________________________________<br clear="none">R-br mailing list<br clear="none"><a shape="rect" ymailto="mailto:R-br@listas.c3sl.ufpr.br" href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br clear="none"><a shape="rect" 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 clear="none">Leia o guia de postagem (<a shape="rect" 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.</div><br><br></div>  </div> </div>  </div></div></body></html>