Re: [R] Row order in plot
Thanks very much for the replies. Both suggestions worked perfectly. That's one more step towards understanding R. Thanks again. -- View this message in context: http://www.nabble.com/Row-order-in-plot-tp20962774p20974800.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
[R] Row order in plot
I'm new to R so forgive me if this seems like a simple question: So I have table where the row titles are string variables. When I plot the data with rows along the x-axis, the data is ordered alphabetically as opposed to the order of the table. How can I preserve the row order of the table in the plot? Thanks in advance. -- View this message in context: http://www.nabble.com/Row-order-in-plot-tp20962774p20962774.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] Row order in plot
This is the format of the table as it appears in R mice X Green.1 Yellow.2 Blue.3 Gray.4 1 Base 469.5399 508.1532 487.1443 492.2544 2PBS 459.6553 474.0124 417.2651 392.9518 3 25 Mch 359.6216 418.0417 377.7020 394.2102 4 50 Mch 206.1835 262.8818 252.8041 172.0568 5 Ext. 287.4200 279.8562 287.3744 236.5091 I have been plotting Green.1 vs X as follows plot(Green.1~X,data=mice) The order on the x axis is alphabetical e.g 25 Mch, 50 Mch, Base, Ext., PBS When I would like it to be : Base, PBS, 25 Mch, 50 Mch, Ext. like in the table. -- View this message in context: http://www.nabble.com/Row-order-in-plot-tp20962774p20963678.html Sent from the R help mailing list archive at Nabble.com. __ R-help@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.