Skip to content

Instantly share code, notes, and snippets.

@nassimhaddad
Created January 15, 2013 16:47
Show Gist options
  • Save nassimhaddad/68e808b0cd6ea12286df to your computer and use it in GitHub Desktop.
Save nassimhaddad/68e808b0cd6ea12286df to your computer and use it in GitHub Desktop.
reorder factor levels, based on : http://stackoverflow.com/q/2375587/1460352
df <- data.frame(f = 1:4, g = letters[1:4])
df$g <- factor(df$g, levels = letters[4:1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment