I am trying to change the order x-axis in this boxplot.
[Now the order is loupe, microscope and video, and I want to change it to microscope, loupe then video]
T
You will need to redefine the order of the factors with the factor
function.
#Sample data
Label<-c("Microscope", "Microscope", "Loupe", "Loupe", "Video", "Video")
mydata<-data.frame(Label)
#print out
levels(mydata$Label)
mydata$Label<-factor(mydata$Label, levels=c("Microscope", "Loupe", "Video"))
#print out
levels(mydata$Label)
See the cookbook-r.com for more information: http://www.cookbook-r.com/Manipulating_data/Changing_the_order_of_levels_of_a_factor/