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: [R] Month Difference > > 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 ! > - Antony > > > > -- > View this message in context: http://r.789695.n4.nabble.com/Month- > Difference-tp4642483.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.