One possibility
as.numeric(format(b, "%m"))-as.numeric(format(a, "%m"))
Regards
Petr
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of Rantony
> Sent: Friday, September 07, 2012 10:26 AM
> To: r-help@r-project.org
> Subject: [
Yes. Its working fine. We need to convert to "as.Date" thatz all.
Thank you Petr.
-Original Message-
From: PIKAL Petr [mailto:petr.pi...@precheza.cz]
Sent: Friday, September 07, 2012 3:42 PM
To: Akkara, Antony (GE Energy, Non-GE); r-help@r-project.org
Subject: RE: [R] Month
Le 07/09/12 10:26, Rantony a écrit :
Hi,
i need a small help.
a<- as.Date("2012-01-01")
b<- as.Date("2012-12-01")
My requirement what is, i need to get the month difference of these two
dates.
Can any one help me please !
Here is a solution from here:
http
On 07-09-2012, at 10:26, Rantony wrote:
> Hi,
>
> i need a small help.
>
> a<- as.Date("2012-01-01")
> b<- as.Date("2012-12-01")
>
> My requirement what is, i need to get the month difference of these two
> dates.
One way is:
library(zoo)
(as.yearmon(b)-
4 matches
Mail list logo