<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.EstiloDeEmail18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="PT-BR" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal"><a name="_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Procura a função para realizar a transposta da matriz que vai dar certo. Mais simples<o:p></o:p></span></a></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></span></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="mso-bookmark:_MailEndCompose"><b><span style="font-size:11.0pt;font-family:"Arial",sans-serif;color:#17375E">João Pedro Araujo Domingues</span></b></span><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#17375E">
</span></span><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;color:#17375E"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#17375E">C
</span></span><span style="mso-bookmark:_MailEndCompose"></span><a href="tel:%2B55%2027%2099232-9582" target="_blank"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:blue">+55 27 99232-9582</span></span><span style="mso-bookmark:_MailEndCompose"></span></a><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p></o:p></span></span></p>
</div>
<p class="MsoNormal"><span style="mso-bookmark:_MailEndCompose"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></span></p>
<span style="mso-bookmark:_MailEndCompose"></span>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">De:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> R-br [mailto:r-br-bounces@listas.c3sl.ufpr.br]
<b>Em nome de </b>Edson Lira via R-br<br>
<b>Enviada em:</b> Thursday, November 16, 2017 11:17 AM<br>
<b>Para:</b> a lista Brasileira oficial de discussão do programa R. <r-br@listas.c3sl.ufpr.br><br>
<b>Assunto:</b> [R-br] Reshape<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div id="yui_3_16_0_ym19_1_1510346106424_183614">
<p class="MsoNormal" style="background:white"><span style="color:black">Bom dia caros amigos, estou trabalhando com a base de dados abaixo(somente 6 linhas):<br>
<br>
<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_183758">
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_183677">
<p class="MsoNormal" style="background:white"><span style="color:black"> id UF x2002 x2003 x2004 x2005 x2006 x2007 x2008 x2009 x2011 x2012 x2013 x2014<br id="yui_3_16_0_ym19_1_1510346106424_183692">
1 1 Acre 192 189 311 311 333 327 338 354 357 381 337 373<br id="yui_3_16_0_ym19_1_1510346106424_183693">
2 2 Alagoas 1251 1269 1292 1357 1413 1410 1355 1401 1344 1391 1429 1417<br id="yui_3_16_0_ym19_1_1510346106424_183694">
3 3 Amapá 204 198 239 262 252 294 317 299 302 311 332 355<br id="yui_3_16_0_ym19_1_1510346106424_183695">
4 4 Amazonas 958 1050 1433 1528 1502 1488 1531 1673 1689 1720 1771 1908<br id="yui_3_16_0_ym19_1_1510346106424_183696">
5 5 Bahia 6885 6901 7167 7336 7292 7338 7665 7792 7602 7416 7530 7879<br id="yui_3_16_0_ym19_1_1510346106424_183697">
6 6 Ceará 3705 3871 3944 4120 4143 4138 4314 4380 4121 4184 4215 4319<br id="yui_3_16_0_ym19_1_1510346106424_183698">
<br>
<br>
<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_183673">
<p class="MsoNormal" style="background:white"><span style="color:black">Estou usando o reshape para tentar transformar as linhas em colunas, ou seja, cada uma UF seria uma coluna, e assim com as demais<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black">Como gostaria que ficasse:<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184034">
<p class="MsoNormal" style="background:white"><span style="color:black">Acre Alagoas Amapá Amazonas Bahia Ceará ano<br>
<br>
<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_183674">
<p class="MsoNormal" style="background:white"><span style="color:black">192 1251 3705 2002<br>
<br>
<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184076">
<p class="MsoNormal" style="background:white"><span style="color:black">189 1269 3871 2003<br>
<br>
<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184078">
<p class="MsoNormal" style="background:white"><span style="color:black">311 1293 3944 2004<br>
<br>
<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184086">
<p class="MsoNormal" style="background:white"><span style="color:black">... ....<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_183628">
<div id="yui_3_16_0_ym19_1_1510346106424_184087">
<p class="MsoNormal" style="background:white"><span style="color:black"> <o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184089">
<p class="MsoNormal" style="background:white"><span style="color:black">Estou usando a rotina:<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184091">
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184093">
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184112">
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="color:black">pea<-reshape(pea1,
<br id="yui_3_16_0_ym19_1_1510346106424_184141">
varying=c("x2002","x2003","x2004","x2005","x2006","x2007",<br id="yui_3_16_0_ym19_1_1510346106424_184142">
"x2008","x2009","x2011","x2012","x2013","x2014"),<br id="yui_3_16_0_ym19_1_1510346106424_184143">
v.names="Medida",<br id="yui_3_16_0_ym19_1_1510346106424_184144">
timevar="UF",<br id="yui_3_16_0_ym19_1_1510346106424_184145">
times=c("Acre","Alagoas","Amapá","Amazonas","Bahia",<br id="yui_3_16_0_ym19_1_1510346106424_184146">
"Ceará","Distrito Federal","Espírito Santo",<br id="yui_3_16_0_ym19_1_1510346106424_184147">
"Goiás","Maranhão","Mato Grosso","Mato Grosso do Sul",<br id="yui_3_16_0_ym19_1_1510346106424_184148">
"Minas Gerais","Pará","Paraíba","Paraná"," Pernambuco",<br id="yui_3_16_0_ym19_1_1510346106424_184149">
"Piauí","Rio de Janeiro","Rio Grande do Norte",<br id="yui_3_16_0_ym19_1_1510346106424_184150">
"Rio Grande do Sul","Rondônia","Roraima",<br id="yui_3_16_0_ym19_1_1510346106424_184151">
"Santa Catarina","São Paulo","Sergipe","Tocantins"),<br id="yui_3_16_0_ym19_1_1510346106424_184152">
new.row.names=1:27,<br id="yui_3_16_0_ym19_1_1510346106424_184153">
direction="wide")<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184160">
<p class="MsoNormal" style="background:white"><span style="color:black">que está me dando o erro:<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184237">
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184162">
<p class="MsoNormal" style="margin-bottom:12.0pt;background:white"><span style="color:black">Erro em varying[, i] : número incorreto de dimensões<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184164">
<p class="MsoNormal" style="background:white"><span style="color:black">Alguém tem alguma sugesstão?<o:p></o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184210">
<p class="MsoNormal" style="background:white"><span style="color:black"><o:p> </o:p></span></p>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_184219">
<p class="MsoNormal" style="background:white"><span style="color:black">[ ]'s<o:p></o:p></span></p>
</div>
</div>
<div id="yui_3_16_0_ym19_1_1510346106424_183630">
<p class="MsoNormal" style="background:white"><span style="color:black">Prof. Edson Lira, Me
<br>
Estatístico<br>
Manaus-Amazonas<o:p></o:p></span></p>
</div>
</div>
</div>
</body>
</html>