Message-ID: <NEBBIPHDAMMOKDKPOFFIKEEGCMAA.abunn@whrc.org>
Date: 2004-11-17T15:26:06Z
From: Andy Bunn
Subject: Time difference in months? (difftime, units)
In-Reply-To: <001001c4ccb2$ad71ae10$7d2501a3@plants.ox.ac.uk>
Is there a way to calculate the number of months between dates?
StartDate <- strptime("01 March 1950", "%d %B %Y")
EventDates <- strptime(c("01 April 1955", "01 July 1980"), "%d %B %Y")
difftime(EventDates, StartDate)
So, there are 61 months between 01 March 1950 and 01 April 1955. There are
364 months between 01 March 1950 and 01 July 1980. What I want is for there
to be a "months" argument to units in difftime. Anybody have a bright idea?
Is there a better way to approach this than difftime?
Thanks in advance, Andy
> version
_
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 2
minor 0.0
year 2004
month 10
day 04
language R