Skip to content
Prev 167706 / 398502 Next

Looking for a special date function in R

Dear Prof. Ripley,

Thank you for help.
Yes, that is an interesting question you pose. I already thought
myself how February should be handled, as EDATE(31.08.2008; -6)
returns 29.02.2008.
In Excel it is not a problem, since this nonexisting date is then used
in VLOOKUP function where one can have Range.Lookup argument set to
TRUE and then it finds the closest value.
Example from Excel (value for 29.02.2008 is recovered from the sorted
table with VLOOKUP function):


21.07.2008	10.00
31.08.2008	20.00
28.02.2008	30.00
01.03.2008	40.00
02.03.2008	50.00
03.03.2008	60.00

29.02.2008	30

I wonder if that kind of functionality is available in R, or one has
to write a piece of code oneself to acheive it.

Thank you for your time and help!

Regards,
Sergey
On Wed, Jan 21, 2009 at 12:44, Prof Brian Ripley <ripley at stats.ox.ac.uk> wrote: