<div dir="ltr">Pessoal,<div>estou tentando fazer uma conversão simples de data e hora armazena em um vetor de caracters para formato <span style="font-family:'Ubuntu Mono';font-size:10.4pt;line-height:1.2;white-space:pre-wrap;color:rgb(0,0,0);background-color:rgb(225,226,229)"> "POSIXlt" "POSIXt"</span>. </div><div>Porém, está acontecendo algo que não entendo ao usar a função strptime.</div><div><br></div><div>Se eu passo o vetor com os dados diretamete, retorna NA.</div><div>Se eu copio e colo os valores na função, dá certo... ou o mesmo usando o dput, como abaixo... vejam...</div><div><br></div><div><br></div><div><div><span class="" style="border-collapse:separate;color:rgb(0,0,0);font-family:'Ubuntu Mono';font-size:12px;border-spacing:0px;background-color:rgb(225,226,229)"><table cellspacing="0" cellpadding="0" class="" style="padding-left:6px;padding-bottom:8px;border:none;outline:none;word-wrap:break-word;width:748px;font-style:inherit!important;font-variant:inherit!important;font-weight:inherit!important;font-stretch:inherit!important;line-height:inherit!important;font-family:inherit!important;white-space:pre-wrap!important;font-size:10.4pt!important"><tbody><tr><td align="left" style="font-family:'Ubuntu Mono';line-height:1.2;vertical-align:top;font-size:10.4pt!important"><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:'Ubuntu Mono';outline:none;border:none;margin-top:0px;margin-bottom:0px;line-height:1.2;font-size:10.4pt!important;white-space:pre-wrap!important"><span class="" style="white-space:pre;color:blue">> </span><span class="" style="color:blue">class(lista.exames[,"Data de Liberação:"])
</span>[1] "character"
<span class="" style="white-space:pre;color:blue">> </span><span class="" style="color:blue"><a href="http://dt.hr">dt.hr</a> <- lista.exames[,"Data de Liberação:"][1:10]
</span><span class="" style="white-space:pre;color:blue">> </span><span class="" style="color:blue">strptime(<a href="http://dt.hr">dt.hr</a>, format = "%d/%m/%Y %H:%M:%S")
</span> [1] NA NA NA NA NA NA NA NA NA NA</pre><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:'Ubuntu Mono';outline:none;border:none;margin-top:0px;margin-bottom:0px;line-height:1.2;font-size:10.4pt!important;white-space:pre-wrap!important"><br></pre><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:'Ubuntu Mono';outline:none;border:none;margin-top:0px;margin-bottom:0px;line-height:1.2;font-size:10.4pt!important;white-space:pre-wrap!important"># não deu certo</pre><pre tabindex="0" class="" id="rstudio_console_output" style="font-family:'Ubuntu Mono';outline:none;border:none;margin-top:0px;margin-bottom:0px;line-height:1.2;font-size:10.4pt!important;white-space:pre-wrap!important"><span class="" style="white-space:pre;color:blue">> </span><span class="" style="color:blue">dput(lista.exames[,"Data de Liberação:"][1:10])
</span>c("10/06/2007   01:03:34", "10/06/2007   01:03:34", "10/06/2007   01:03:34", 
"10/06/2007   01:03:34", "10/06/2007   01:03:34", "10/06/2007   01:03:34", 
"10/06/2007   01:03:34", "10/06/2007   01:03:34", "10/06/2007   01:03:34", 
"10/06/2007   01:03:34")
<span class="" style="white-space:pre;color:blue">> </span><span class="" style="color:blue"><a href="http://dt.hr">dt.hr</a> <- c("10/06/2007   01:03:34", "10/06/2007   01:03:34", "10/06/2007   01:03:34",
</span><span class="" style="white-space:pre;color:blue">+ </span><span class="" style="color:blue">"10/06/2007   01:03:34", "10/06/2007   01:03:34", "10/06/2007   01:03:34",
</span><span class="" style="white-space:pre;color:blue">+ </span><span class="" style="color:blue">"10/06/2007   01:03:34", "10/06/2007   01:03:34", "10/06/2007   01:03:34",
</span><span class="" style="white-space:pre;color:blue">+ </span><span class="" style="color:blue">"10/06/2007   01:03:34")
</span><span class="" style="white-space:pre;color:blue">> </span><span class="" style="color:blue">strptime(<a href="http://dt.hr">dt.hr</a>, format = "%d/%m/%Y %H:%M:%S")
</span> [1] "2007-06-10 01:03:34 BRT" "2007-06-10 01:03:34 BRT" "2007-06-10 01:03:34 BRT"
 [4] "2007-06-10 01:03:34 BRT" "2007-06-10 01:03:34 BRT" "2007-06-10 01:03:34 BRT"
 [7] "2007-06-10 01:03:34 BRT" "2007-06-10 01:03:34 BRT" "2007-06-10 01:03:34 BRT"
[10] "2007-06-10 01:03:34 BRT"
</pre></td></tr><tr><td align="left" style="font-family:'Ubuntu Mono';line-height:1.2;vertical-align:top;font-size:10.4pt!important"></td></tr><tr><td align="left" style="font-family:'Ubuntu Mono';line-height:1.2;vertical-align:top;font-size:10.4pt!important"><table cellspacing="0" cellpadding="0" style="width:748px"><tbody><tr><td align="left" width="1" height="" rowspan="1" style="font-family:'Ubuntu Mono';line-height:1.2;vertical-align:top;font-size:10.4pt!important"><div class="" style="white-space:pre;color:blue">> </div><div class="" style="white-space:pre;color:blue"># deu certo!!</div><div class="" style="white-space:pre;color:blue"><br></div><div class="" style="white-space:pre">O que pode estar ocorrendo? Não basta o meu vetor original ser do tipo character?</div><div class="" style="white-space:pre;color:blue"><br></div><div class="" style="white-space:pre;color:blue"><br></div></td></tr></tbody></table></td></tr></tbody></table></span></div></div><div><div><div class="gmail_signature"><div dir="ltr"><div><div>Abraços,<br></div><div>Paulo<br></div></div></div></div></div>
</div></div>