<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)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"Lucida Console";
panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"Pré-formatação HTML Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.Pr-formataoHTMLChar
{mso-style-name:"Pré-formatação HTML Char";
mso-style-priority:99;
mso-style-link:"Pré-formatação HTML";
font-family:"Consolas",serif;
mso-fareast-language:PT-BR;}
span.EstiloDeEmail20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
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=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Acho que tem que converter isso pra string e preencher o início com ZERO, caso o dia seja entre 1 e 9.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Depois é só usar as.date(sua var string, '%d/%m/%Y')<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'>Não lembro como colocar ZERO antes <o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US'><o:p> </o:p></span></p><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>Wagner Tassinari<br><b>Enviada em:</b> terça-feira, 12 de janeiro de 2016 12:00<br><b>Para:</b> r-br@listas.c3sl.ufpr.br<br><b>Assunto:</b> [R-br] Formatando datas<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal style='margin-bottom:12.0pt'>Olá pessoal,<o:p></o:p></p></div><p class=MsoNormal style='mso-line-height-alt:11.25pt'>Estou com um probleminha. Em meu banco de dados, minha variável data se encontra desta forma:<br><br><br><span style='font-size:10.0pt;font-family:"Lucida Console";color:black;background:#E1E2E5'><o:p></o:p></span></p><pre><span style='font-family:"Lucida Console";color:blue;background:#E1E2E5'>> data<o:p></o:p></span></pre><pre><span style='font-family:"Lucida Console";color:black;background:#E1E2E5'> [1] 4042009 4042009 27072009 27072009 27072009 6082010 6082010 6082010<o:p></o:p></span></pre><pre><span style='font-family:"Lucida Console";color:black;background:#E1E2E5'> [9] 6082010 6082010<o:p></o:p></span></pre><pre><span style='font-family:"Lucida Console";color:blue;background:#E1E2E5'>> library(chron)<o:p></o:p></span></pre><pre><span style='font-family:"Lucida Console";color:blue;background:#E1E2E5'>> data2 = chron(dates=data, format=c('dd/mm/yy'))<o:p></o:p></span></pre><pre><span style='font-family:"Lucida Console";color:blue;background:#E1E2E5'>> data2<o:p></o:p></span></pre><pre><span style='font-family:"Lucida Console";color:black;background:#E1E2E5'> [1] 24/Aug/13036 24/Aug/13036 23/Aug/76090 23/Aug/76090 23/Aug/76090 24/Dec/18621<o:p></o:p></span></pre><pre style='margin-bottom:12.0pt'><span style='font-family:"Lucida Console";color:black;background:#E1E2E5'> [7] 24/Dec/18621 24/Dec/18621 24/Dec/18621 24/Dec/18621<o:p></o:p></span></pre><pre style='line-height:11.25pt;font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-width:initial;border-color:initial;white-space:pre-wrap!important' id="rstudio_console_output"><span style='font-family:"Lucida Console";color:black;background:#E1E2E5'>O certo seria: <br><br><br><o:p></o:p></span></pre><pre style='margin-bottom:12.0pt'><span style='font-family:"Lucida Console";color:black;background:#E1E2E5'>[1] 04/04/2009 04/04/2009 27/07/2009 27/07/2009 06/08/2010 ...<o:p></o:p></span></pre><pre style='margin-bottom:12.0pt;font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-width:initial;border-color:initial;white-space:pre-wrap!important' id="rstudio_console_output"><span style='font-family:"Lucida Console";color:black;background:#E1E2E5'>Alguém poderia me dar uma dica ?<o:p></o:p></span></pre><pre style='font-size:10pt!important;outline-style:none;outline-width:initial;outline-color:initial;border-width:initial;border-color:initial;white-space:pre-wrap!important' id="rstudio_console_output"><span style='font-family:"Lucida Console";color:black;background:#E1E2E5'>Obrigado<o:p></o:p></span></pre><p class=MsoNormal><o:p> </o:p></p><div><div><p class=MsoNormal>-- <o:p></o:p></p><div><p class=MsoNormal>Wagner S. Tassinari<br>Departamento de Matemática<br>Universidade Federal Rural do Rio de Janeiro.<br>BR-465, Km 7 - Seropedica, RJ - Brasil<br>CEP: 23890-000 <br>Skype: wagner.tassinari<br><a href="mailto:wtassinari@gmail.com" target="_blank">wtassinari@gmail.com</a><br><a href="mailto:tassinari@ufrrj.br" target="_blank">tassinari@ufrrj.br</a><br>-------------------------------------------------------<br>"Statistical thinking will one day be as necessary for efficient citizenship as the ability to read and write." (H.G.Wellis)<o:p></o:p></p></div></div></div><div id=DDB4FAA8-2DD7-40BB-A1B8-4E2AA1F9FDF2><table class=MsoNormalTable border=1 cellpadding=0 style='border:none;border-top:solid #AAABB6 1.0pt'><tr><td width=105 style='width:78.75pt;border:none;padding:11.25pt .75pt .75pt .75pt'><p class=MsoNormal style='margin-top:22.5pt'><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><span style='text-decoration:none'><img border=0 id="_x0000_i1025" src="https://ipmcdn.avast.com/images/logo-avast-v1.png"></span></a><o:p></o:p></p></td><td width=470 style='width:352.5pt;border:none;padding:15.0pt .75pt .75pt .75pt'><p class=MsoNormal style='margin-top:22.5pt;line-height:13.5pt'><span style='font-size:10.0pt;font-family:"Arial",sans-serif;color:#41424E'>Este e-mail foi enviado por um computador sem vírus e protegido pelo Avast. <br><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><span style='color:#4453EA'>www.avast.com</span></a> <o:p></o:p></span></p></td></tr></table><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>