Skip to content
Prev 274824 / 398506 Next

Ordering of stack in ggplot (package ggplot2)

On Oct 18, 2011, at 7:59 PM, swonder03 wrote:

            
Change the order of the levels in a factor variable:

 > levels(df.m2$Var2)
[1] "Africa"   "Americas" "Asia"     "Europe"   "Oceania"
 > levels(df.m2$Var2) <- c("Europe", "Asia", "Americas" , "Africa"  ,   
"Oceania" )
 >

My efforts to replicate your code founded on the fact that your  
rename() operation seemed to have the wrong targets (or perhaps it is  
from a package you did not tell us about. (I did load rehape2.