There is an object "LETTERS" which displays all letters from "a" to "z". Is there any similar object whicg displays the "months" as well in chronological order? like "jan", "feb",...........,"dec" Thanks, -- View this message in context: http://www.nabble.com/Is-there-any-%22month%22-object-like-%22LETTERS%22---tp25396125p25396125.html Sent from the R help mailing list archive at Nabble.com.
On Fri, Sep 11, 2009 at 8:13 AM, megh <megh700004 at yahoo.com> wrote:> > There is an object "LETTERS" which displays all letters from "a" to "z". Is > there any similar object whicg displays the "months" as well in > chronological order? like "jan", "feb",...........,"dec"You could construct a vector of the first of the month for some year and then use months() or format() on it: > months(ISOdatetime(1960,1:12,1,0,0,0)) [1] "January" "February" "March" "April" "May" "June" [7] "July" "August" "September" "October" "November" "December" > format(ISOdatetime(1960,1:12,1,0,0,0),"%b") [1] "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec" Note these are locale-dependent, so les Francais will see something else. Probably "Jan","Fev","Mar","Avr" and so on... Barry
See ?Constants On Fri, Sep 11, 2009 at 3:13 AM, megh <megh700004 at yahoo.com> wrote:> > There is an object "LETTERS" which displays all letters from "a" to "z". Is > there any similar object whicg displays the "months" as well in > chronological order? like "jan", "feb",...........,"dec" > > Thanks, > -- > View this message in context: http://www.nabble.com/Is-there-any-%22month%22-object-like-%22LETTERS%22---tp25396125p25396125.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at 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. >