M<-mondate.mdy(6,30,2008)
year(M) # 2008
month(M) # 6
day(M) # 30
mondate.ymd(2008,6,30) # ditto
mondate.ymd(2008,6) # ditto; 'day' argument is "missing" so
# returns the last day of the month
mondate.ymd(2008,1:12) # all month-ends of 2008, a leapyear
# year-ends 2001 through 2010, displaying only the 4-digit year when shown
mondate.ymd(2001:2010, displayFormat="%Y")
mondate.ymd(2010:2012, NA) # NA mondate vector of length 3
mondate.ymd(Inf,11,31) # An infinite mondate even though only 30 days in
# November
Run the code above in your browser using DataLab