An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20131225/36d9f828/attachment.pl>
x-axis value in boxplot
2 messages · Kochikkaran Musammilu, David Winsemius
On Dec 24, 2013, at 9:02 PM, Kochikkaran Musammilu wrote:
Hai, I am new to ?R? software. I have a doubt, while doing analysis, keeping the x axis value as year, in graphical representation (ie, in boxplot) the values comes as "X2005", and "X2006" and so on in x axis. How to keep "2005", "2006" as x axis value instead of "X2005" and "X2006". In gist, there comes a prefix "X" before the numeric value of X axis variables. How to solve this problem? If any suggestions/guidance, please feel free to write <musammilu at hotmail.com>. Kindly give me the "R" command to get rid of above problem!
`boxplot` has a names argument. If you are passing a dataframe with a 'grp' variable to boxplot.formula, then try:
boxplot( ... , names = sub("^X", "" dfrm$grp), ...)
See ?regex and ?sub
If this does not address your specific problem, then you would need to be .... more specific.
David Winsemius Alameda, CA, USA