Hi
>>TODAY <- as.POSIXlt('2004-01-17')
>>LYTODAY <- as.POSIXlt('2003-01-17')
>>DAYS <- TODAY-LYTODAY
>>DAYS
Time difference of 365 days
>>DAYS[[1]]
[1] 365
perhaps it helps,
Christian
Dennis Fisher wrote:
I have data in the following format:
> DATE
[1] "01/13/2004"
In order to find the d
Dennis Fisher <[EMAIL PROTECTED]> writes:
> I have data in the following format:
>
> > DATE
> [1] "01/13/2004"
>
> In order to find the difference between two data points, I presently
> use brute force to calculate the day of the year:
>
> > strptime(DATE, format="%m/%d/%Y")$yday
> [1] 12
>
I have data in the following format:
> DATE
[1] "01/13/2004"
In order to find the difference between two data points, I presently
use brute force to calculate the day of the year:
> strptime(DATE, format="%m/%d/%Y")$yday
[1] 12
Although this works, it may not be robust over different years. I
a