This is how I get the month names from within R:> mon <- rep(strptime("01/01/1952", format = "%d/%m/%Y"), 12) > mon$mon <- mon$mon + 0:11 > mnam <- months(mon, abbreviate = F) > mnam[1] "januar" "februar" "marts" "april" "maj" "juni" "juli" "august" "september" [10] "oktober" "november" "december" Surely someone on the list can beat that in elegance? Bendix Carstensen ---------------------- Bendix Carstensen Senior Statistician Steno Diabetes Center Niels Steensens Vej 2 DK-2820 Gentofte Denmark tel: +45 44 43 87 38 mob: +45 30 75 87 38 fax: +45 44 43 07 06 bxc at steno.dk www.biostat.ku.dk/~bxc
format(ISOdate(2000, 1:12, 1), "%B") On Mon, 24 May 2004, BXC (Bendix Carstensen) wrote:> This is how I get the month names from within R: > > > mon <- rep(strptime("01/01/1952", format = "%d/%m/%Y"), 12) > > mon$mon <- mon$mon + 0:11 > > mnam <- months(mon, abbreviate = F) > > mnam > [1] "januar" "februar" "marts" "april" "maj" "juni" > "juli" "august" "september" > [10] "oktober" "november" "december" > > Surely someone on the list can beat that in elegance?-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
How about `month.name'? -roger BXC (Bendix Carstensen) wrote:> This is how I get the month names from within R: > > >>mon <- rep(strptime("01/01/1952", format = "%d/%m/%Y"), 12) >>mon$mon <- mon$mon + 0:11 >>mnam <- months(mon, abbreviate = F) >>mnam > > [1] "januar" "februar" "marts" "april" "maj" "juni" > "juli" "august" "september" > [10] "oktober" "november" "december" > > Surely someone on the list can beat that in elegance? > > Bendix Carstensen > ---------------------- > Bendix Carstensen > Senior Statistician > Steno Diabetes Center > Niels Steensens Vej 2 > DK-2820 Gentofte > Denmark > tel: +45 44 43 87 38 > mob: +45 30 75 87 38 > fax: +45 44 43 07 06 > bxc at steno.dk > www.biostat.ku.dk/~bxc > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >