Change the label of legend not by changing…

Change the label of legend not by changing the data.

http://stackoverflow.com/questions/7323191/how-do-i-manually-change-the-key-labels-in-a-legend-in-ggplot2

R factors levels labels # sample data originally…

R factors, levels, labels

Conclusion By default, factor() order the levels alphabetical order or numerical order. If you want to change the sorting order of levels manually, you need to set it when the factor is created. It can