[R] Need help on date calculation

2010-07-12 Thread Daniel Murphy
"last-day-of-the-month's" because mondate represents them as numerics with zero fractional part. Hope that helps, Dan Murphy = Message: 26 Date: Sat, 10 Jul 2010 15:17:07 -0400 From: Gabor Grothendieck To: Bogaso Christofer Cc: r-help@

Re: [R] Need help on date calculation

2010-07-10 Thread Gabor Grothendieck
On Sat, Jul 10, 2010 at 3:17 PM, Gabor Grothendieck wrote: > On Sat, Jul 10, 2010 at 3:34 PM, Bogaso Christofer > wrote: >> Thanks Gabor for your input. However my question is, is your solution >> general for any value of "a" and "b?" >> > > #1 and #2 are general. > > For #3 I think there is a po

Re: [R] Need help on date calculation

2010-07-10 Thread Gabor Grothendieck
On Sat, Jul 10, 2010 at 3:34 PM, Bogaso Christofer wrote: > Thanks Gabor for your input. However my question is, is your solution > general for any value of "a" and "b?" > #1 and #2 are general. For #3 I think there is a possibility you might in general have to do the same tricks as #1 and #2 bu

Re: [R] Need help on date calculation

2010-07-10 Thread David Winsemius
On Jul 10, 2010, at 3:17 PM, Bogaso Christofer wrote: Hi all, please see my code: library(zoo) a <- as.yearmon("March-2010", "%B-%Y") b <- as.yearmon("May-2010", "%B-%Y") nn <- (b-a)*12 # number of months in between them nn [1] 2 as.integer(nn) [1] 1 What is the correct way to find

Re: [R] Need help on date calculation

2010-07-10 Thread Bogaso Christofer
Thanks Gabor for your input. However my question is, is your solution general for any value of "a" and "b?" -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: 11 July 2010 00:42 To: Bogaso Christofer Cc: r-help@r-project.org Subject:

Re: [R] Need help on date calculation

2010-07-10 Thread Gabor Grothendieck
On Sat, Jul 10, 2010 at 3:07 PM, Gabor Grothendieck wrote: > On Sat, Jul 10, 2010 at 3:17 PM, Bogaso Christofer > wrote: >> Hi all, please see my code: >> >> >> >>> library(zoo) >> >>> a <- as.yearmon("March-2010", "%B-%Y") >> >>> b <- as.yearmon("May-2010", "%B-%Y") >> >>> >> >>> nn <- (b-a)*12

Re: [R] Need help on date calculation

2010-07-10 Thread Gabor Grothendieck
On Sat, Jul 10, 2010 at 3:17 PM, Bogaso Christofer wrote: > Hi all, please see my code: > > > >> library(zoo) > >> a <- as.yearmon("March-2010", "%B-%Y") > >> b <- as.yearmon("May-2010", "%B-%Y") > >> > >> nn <- (b-a)*12   # number of months in between them > >> nn > > [1] 2 > >> as.integer(nn) >

[R] Need help on date calculation

2010-07-10 Thread Bogaso Christofer
Hi all, please see my code: > library(zoo) > a <- as.yearmon("March-2010", "%B-%Y") > b <- as.yearmon("May-2010", "%B-%Y") > > nn <- (b-a)*12 # number of months in between them > nn [1] 2 > as.integer(nn) [1] 1 What is the correct way to find the number of months between "a" and