阅读背景:

R中矢量日期之间的时间

来源:互联网 

Given a vector of dates, V.dates, write a function that determines the time, in days, from present day for each element. Next determine the quarter, as defined by 91 day segments, from present day in reverse chronological order. Define quarter '0' to be the time between present day and (present day - 91), quarter '1' to be (present day - 91) to (present day - 182), etc. Lastly, return a data frame that contains the original date, the duration from present day, and the quarter to which the date belongs. Keep in mind that dates may be before or after present day. For example, assuming present day is '10/27/2010' and an input date of '6/20/2009', the function should return that the input date is 494 days from present day and belongs in quarter 5.Given a vector of dates, V.dates, write a funct




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: