An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070620/e2bee106/attachment.pl
Replace number with month
3 messages · Spilak,Jacqueline [Edm], Nordlund, Dan (DSHS/RDA), John Kane
-----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Spilak,Jacqueline [Edm] Sent: Wednesday, June 20, 2007 3:13 PM To: r-help at stat.math.ethz.ch Subject: [R] Replace number with month Hi all I have a multiple datasets that look like this MM Freq 1 30 2 35 3 54 4 33 5 27 6 13 7 25 8 29 9 40 10 32 11 36 12 23 I am plotting this using barchart (there is probably something better but it gives me the results I want) and I would like the x-axis to have the names of the months instead of the month numbers. So I have searched and searched and I am not sure if I have to change it before I graph it or if I can somehow change it in barchart. Any help is most appreciated. Jacquie [[alternative HTML version deleted]]
______________________________________________ R-help at stat.math.ethz.ch 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.
Jacquie, Try month.name[MM]or month.abb[MM]. Hope this is helpful, Dan Daniel J. Nordlund Research and Data Analysis Washington State Department of Social and Health Services Olympia, WA 98504-5204
Simple brute force approach that should work:
barplot(Freq,MM, names=c('Jan','Feb','Mar', 'Apr',
'May', 'Jun','Jul', 'Aug', 'Sept', 'Oct','Nov',
'Dec'))
--- "Spilak,Jacqueline [Edm]"
<Jacqueline.Spilak at EC.gc.ca> wrote:
Hi all I have a multiple datasets that look like this MM Freq 1 30 2 35 3 54 4 33 5 27 6 13 7 25 8 29 9 40 10 32 11 36 12 23 I am plotting this using barchart (there is probably something better but it gives me the results I want) and I would like the x-axis to have the names of the months instead of the month numbers. So I have searched and searched and I am not sure if I have to change it before I graph it or if I can somehow change it in barchart. Any help is most appreciated. Jacquie [[alternative HTML version deleted]]
______________________________________________ R-help at stat.math.ethz.ch 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.