You should read ?daystoyears more carefully. There is a details section
where you read:
Details:
The "years" time-scale uses one unit for each year. We
deliberately "linearized" time in this time-scale and each year
has 365.25 days. There is thus no adjustment for bissextile years.
Similarly, one month is considered to be 1/12 year, no mather if
it has 28, 29, 30 or 31 days. This representation simplifies
further calculations, especially regarding seasonal effects (a
quarter is exactly 0.25 units for instance), but introduces some
shifts in time (of up to one day, which is not significant when
working on long-term series with years as units). However,
converting it back to "days", using 'yearstodays()'
restablishes
correct initial days without errors.
Expect thus, as explained in that section, some shifts of up to one day in
the calculation.
Best,
Philippe Grosjean
.......................................................<?}))><....
) ) ) ) )
( ( ( ( ( Prof. Philippe Grosjean
\ ___ )
\/ECO\ ( Numerical Ecology of Aquatic Systems
/\___/ ) Mons-Hainaut University, Pentagone
/ ___ /( 8, Av. du Champ de Mars, 7000 Mons, Belgium
/NUM\/ )
\___/\ ( phone: + 32.65.37.34.97, fax: + 32.65.37.33.12
\ ) email: Philippe.Grosjean at umh.ac.be
) ) ) ) ) SciViews project coordinator (http://www.sciviews.org)
( ( ( ( (
...................................................................
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
[mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Angel Lopez
Sent: Friday, 19 March, 2004 11:26
To: R-help at stat.math.ethz.ch
Subject: [R] date conversions in pastecs
In function daystoyears in package pastecs, I get this (wrong?) result
with 1995:
> daystoyears(1,datemin="1/1/1997",dateformat="m/d/Y")
1997.001
> daystoyears(1,datemin="1/1/1995",dateformat="m/d/Y")
1994.999
Any insights?
Thanks
Angel
______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html