<html><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:12pt"><div><span>André, valeu! </span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "><span>O problema é que quando trabalhamos com arquivos texto, csv, as datas e/ou tempos são vistos como fatores. Não consegui implementar sua idéia, fiz o seguinte:</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal;
 "><span>Transformei o arquivo em excell (xlsx)</span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "><span><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "><span>Nesta forma o R entende como </span><span style="font-size: 12pt; ">POSIXct e atribui uma data para as horas</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "><span style="font-size: 12pt; ">Usei a rotina difftime</span></div><div style="color: rgb(0, 0, 0); font-size: 12pt; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "><span style="font-size: 12pt; "><br></span></div><div style="color: rgb(0, 0, 0); font-size: 16px;
 font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "><span style="font-size: 12pt; "><div style="margin-left: 4px; text-indent: -4px; font-size: 14.7px; font-family: Courier; color: rgb(7, 26, 153); "><span style="color: #000000">m</span>$<span style="color: #000000">hs</span><-format(as.Date(<span style="color: #000000">m</span>$<span style="color: #000000">Saída</span>,<span style="color: #b01600">"H:M"</span>))</div>
<div style="margin-left: 4px; text-indent: -4px; font-size: 14.7px; font-family: Courier; color: rgb(7, 26, 153); "><span style="color: #000000">m</span>$<span style="color: #000000">he</span><-format(as.Date(<span style="color: #000000">m</span>$<span style="color: #000000">Entrada</span>,<span style="color: #b01600">"H:M"</span>))</div><div><br></div><div><div style="margin-left: 4px; text-indent: -4px; font-size: 14.7px; font-family: Courier; ">m<span style="color: #071a99">$</span>ht<span style="color: #071a99"><-difftime(</span>m<span style="color: #071a99">$</span>Saída<span style="color: #071a99">,</span>m<span style="color: #071a99">$</span>Entrada<span style="color: #071a99">)</span></div>
<div style="margin-left: 4px; text-indent: -4px; font-size: 14.7px; font-family: Courier; color: rgb(7, 26, 153); "><span style="color: #000000">m</span>$<span style="color: #000000">htrab</span><-as.numeric(<span style="color: #000000">m</span>$<span style="color: #000000">ht</span>)/<span style="color: #045218">60</span></div><div><span style="color: #045218"><br></span></div></div></span></div><div></div><div>Muito obrigado!!! </div><div>Edson Lira<br>Estatístico<br>Manaus-Amazonas<br></div>  <div style="font-family: 'lucida console', sans-serif; font-size: 12pt; "> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "> <div dir="ltr"> <hr size="1">  <font size="2" face="Arial"> <b><span style="font-weight:bold;">De:</span></b> "andrebvs@bol.com.br" <andrebvs@bol.com.br><br> <b><span style="font-weight: bold;">Para:</span></b> r-br@listas.c3sl.ufpr.br; Edson Lira <edinhoestat@yahoo.com.br> <br>
 <b><span style="font-weight: bold;">Enviadas:</span></b> Segunda-feira, 1 de Julho de 2013 12:36<br> <b><span style="font-weight: bold;">Assunto:</span></b> Re: [R-br] diferenca em horas<br> </font> </div> <div class="y_msg_container"><br><div id="yiv6321536889"><div>Não precisa de pacote, acho que é isso abaixo:<br><br># Seus dados salvo em "EnterExit.txt":</div>
<div><br>Entrada    Saída<br>13.00    17.00<br>15.01    16.38<br>   .</div>
<div>   .</div>
<div>   .</div>
<div>15.12    17.40<br><br>dados <- read.table("EnterExit.txt",h=T)<br>attach(dados)<br><br>dif <- mean(Saída-Entrada)<br><br>[1]  1.767143<br><br><i>Att.</i><br><i>André BVS</i><br><br></div>
<hr style="border-top:1px solid #ccc;">
<div>Em 01/07/2013 13:16, <b>Edson Lira < edinhoestat@yahoo.com.br ></b> escreveu:</div>
<div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: 'lucida console', sans-serif; font-size: 12pt; ">
<div>Caros amigos da Lista, tenho um banco com as variáveis abaixo:</div>
<div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "> </div>
<table width="480" border="0" cellspacing="0" cellpadding="0"><colgroup><col width="106"><col width="83"><col width="54"><col span="2" width="64"></colgroup>
<tbody>
<tr>
<td class="yiv6321536889xl65" style="height:15.0pt;width:80pt;" width="106" height="20">Dia_da_Semana</td>
<td class="yiv6321536889xl65" style="width:62pt;" width="83"> Dia_do_Mês </td>
<td class="yiv6321536889xl65" style="width:41pt;" width="54">Entrada</td>
<td class="yiv6321536889xl65" style="width:48pt;" width="64">Saída</td>
<td class="yiv6321536889xl66" style="width:48pt;" width="64">Semana</td>
</tr>
</tbody>
</table>
<div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "> </div>
<div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; ">No link abaixo está um banco teste para vocês analisarem.</div>
<div style="color: rgb(0, 0, 0); font-size: 16px; font-family: 'lucida console', sans-serif; background-color: transparent; font-style: normal; "> </div>
<table width="4" border="0" cellspacing="0" cellpadding="0"><colgroup><col width="106"><col width="83"><col width="54"><col span="2" width="64"></colgroup>
<tbody>
<tr>
<td class="yiv6321536889xl63" style="height:15.0pt;width:80pt;" width="106" height="20"> </td>
<td class="yiv6321536889xl63" style="width:48pt;" width="64"> </td>
<td class="yiv6321536889xl64" style="width:48pt;" width="64"> </td>
</tr>
</tbody>
</table>
 <a rel="nofollow" target="_blank" href="http://www1.datafilehost.com/d/320c3ab5">http://www1.datafilehost.com/d/320c3ab5</a><br>
<div><br>Quero calcular a diferença de tempo entre a entrada e  a saída. Para poder analisar tempo médio por semana.<br><br>Não estou conseguindo implementar nos pacotes chron e lubridate. <br><br>Alguém poderia me ajudar?<br><br><br>[ ]'s.</div>
<div>Edson Lira<br>Estatístico<br>Manaus-Amazonas</div>
</div>
<div> </div>
</div><br><br></div> </div> </div>  </div></body></html>