<div dir="ltr">Edmar,<div><br></div><div>Se você quer fazer o cálculo "na unha" para o número de dias, o melhor é usar o divisor 365.25 para levar em conta os anos bissextos¹</div><div><br></div><div>Enquanto as propostas tanto de floor() como as.integer() façam o que você especificou, veja se não vale a pena você arrendondar levando em conta a fração, pois no caso do seu exemplo 38,8 está mais para 39 que 38 anos. . .</div><div><br></div><div>HTH</div><div>--</div><div>Cesar Rabak</div><div><br></div><div><br></div><div>[1] Esse procedimento é usado até em programas da OMS.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-03-23 15:35 GMT-03:00 Edmar Caldas via R-br <span dir="ltr"><<a href="mailto:r-br@listas.c3sl.ufpr.br" target="_blank">r-br@listas.c3sl.ufpr.br</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:12px"><div id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_2886"><span></span></div><div id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_2886"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3108">Pessoal, </span></div><div id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_2886"><span><br></span></div><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3039"><span style="font-family:"Lucida Console"" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3040">Preciso de uma ajuda em um calculo entre 02 datas. Preciso que o resultado seja numero inteiro que nesse caso é 38 anos.<u></u><u></u></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3042"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3043"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3044"><u></u> <u></u></span></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3050"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3051"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3052">> </span></span><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3053"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3054">data_nascimento <- as.Date("1978-06-14")<u></u><u></u></span></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3056"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3057"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3058"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3059">> </span></span></span><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3060"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3061">data_nascimento<u></u><u></u></span></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3063"><span style="font-family:"Lucida Console"" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3064">[1] "1978-06-14"<u></u><u></u></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3066"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3067"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3068"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3069">> </span></span></span><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3070"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3071">data_hoje <-as.Date("2017-03-23")<u></u><u></u></span></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3073"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3074"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3075"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3076">> </span></span></span><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3077"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3078">data_hoje<u></u><u></u></span></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3080"><span style="font-family:"Lucida Console"" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3081">[1] "2017-03-23"<u></u><u></u></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3083"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3084"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3085"><u></u> <u></u></span></span><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3087"></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3088"><span style="font-family:"Lucida Console"" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3089"><u></u> <u></u></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3091"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3092"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3093"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3094">> </span></span></span><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3095"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3096">idade <-difftime(data_hoje, data_nascimento)/365<u></u><u></u></span></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3098"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3099"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3100"><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3101">> </span></span></span><span id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3102"><span style="font-family:"Lucida Console";color:blue" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3103">idade<u></u><u></u></span></span></pre><pre style="line-height:11.25pt;background-image:initial;background-position:initial;background-size:initial;background-repeat:initial;background-origin:initial;background-clip:initial;word-break:break-all" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3105"><span style="font-family:"Lucida Console"" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3106">Time difference of 38.8 days<span class="HOEnZb"><font color="#888888"><u></u><u></u></font></span></span></pre><span class="HOEnZb"><font color="#888888"><div></div><div id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3127"> </div><div class="m_-759391588956748662signature" id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3129"><div id="m_-759391588956748662yui_3_16_0_ym19_1_1490294078966_3128"><font color="#0000ff">Edmar</font></div></div></font></span></div></div><br>______________________________<wbr>_________________<br>
R-br mailing list<br>
<a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>
<a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br" rel="noreferrer" target="_blank">https://listas.inf.ufpr.br/<wbr>cgi-bin/mailman/listinfo/r-br</a><br>
Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia" rel="noreferrer" target="_blank">http://www.leg.ufpr.br/r-br-<wbr>guia</a>) e forneça código mínimo reproduzível.<br></blockquote></div><br></div>